Revision ae88ef45 lib/rpc.py

b/lib/rpc.py
32 32

  
33 33
import os
34 34
import socket
35
import httplib
36 35
import logging
37 36

  
38 37
from ganeti import utils
......
42 41
from ganeti import constants
43 42
from ganeti import errors
44 43

  
44
import ganeti.http.client
45

  
45 46

  
46 47
# Module level variable
47 48
_http_manager = None
......
57 58

  
58 59
  assert not _http_manager, "RPC module initialized more than once"
59 60

  
60
  _http_manager = http.HttpClientManager()
61
  _http_manager = http.client.HttpClientManager()
61 62

  
62 63

  
63 64
def Shutdown():
......
156 157
    if address is None:
157 158
      address = name
158 159

  
159
    self.nc[name] = http.HttpClientRequest(address, self.port, http.HTTP_PUT,
160
                                           "/%s" % self.procedure,
161
                                           post_data=self.body,
162
                                           ssl_params=self._ssl_params,
163
                                           ssl_verify_peer=True)
160
    self.nc[name] = \
161
      http.client.HttpClientRequest(address, self.port, http.HTTP_PUT,
162
                                    "/%s" % self.procedure,
163
                                    post_data=self.body,
164
                                    ssl_params=self._ssl_params,
165
                                    ssl_verify_peer=True)
164 166

  
165 167
  def GetResults(self):
166 168
    """Call nodes and return results.
......
176 178
    results = {}
177 179

  
178 180
    for name, req in self.nc.iteritems():
179
      if req.success and req.resp_status == http.HTTP_OK:
181
      if req.success and req.resp_status_code == http.HTTP_OK:
180 182
        results[name] = RpcResult(data=serializer.LoadJson(req.resp_body),
181 183
                                  node=name, call=self.procedure)
182 184
        continue

Also available in: Unified diff