Merge branch 'devel-2.4'
[ganeti-local] / lib / confd / server.py
index 0df0061..e3dc58e 100644 (file)
@@ -54,6 +54,7 @@ class ConfdProcessor(object):
     constants.CONFD_REQ_CLUSTER_MASTER: querylib.ClusterMasterQuery,
     constants.CONFD_REQ_NODE_PIP_LIST: querylib.NodesPipsQuery,
     constants.CONFD_REQ_MC_PIP_LIST: querylib.MasterCandidatesPipsQuery,
+    constants.CONFD_REQ_INSTANCES_IPS_LIST: querylib.InstancesIpsQuery,
     }
 
   def __init__(self):
@@ -61,7 +62,7 @@ class ConfdProcessor(object):
 
     """
     self.disabled = True
-    self.hmac_key = utils.ReadFile(constants.HMAC_CLUSTER_KEY)
+    self.hmac_key = utils.ReadFile(constants.CONFD_HMAC_KEY)
     self.reader = None
     assert \
       not constants.CONFD_REQS.symmetric_difference(self.DISPATCH_TABLE), \
@@ -99,7 +100,7 @@ class ConfdProcessor(object):
       payload_out = self.PackReply(reply, rsalt)
       return payload_out
     except errors.ConfdRequestError, err:
-      logging.info('Ignoring broken query from %s:%d: %s' % (ip, port, err))
+      logging.info('Ignoring broken query from %s:%d: %s', ip, port, err)
       return None
 
   def ExtractRequest(self, payload):
@@ -109,7 +110,7 @@ class ConfdProcessor(object):
 
     """
     current_time = time.time()
-    logging.debug("Extracting request with size: %d" % (len(payload)))
+    logging.debug("Extracting request with size: %d", len(payload))
     try:
       (message, salt) = serializer.LoadSigned(payload, self.hmac_key)
     except errors.SignatureError, err:
@@ -141,7 +142,7 @@ class ConfdProcessor(object):
     @return: tuple of reply and salt to add to the signature
 
     """
-    logging.debug("Processing request: %s" % request)
+    logging.debug("Processing request: %s", request)
     if request.protocol != constants.CONFD_PROTOCOL_VERSION:
       msg = "wrong protocol version %d" % request.protocol
       raise errors.ConfdRequestError(msg)
@@ -164,7 +165,7 @@ class ConfdProcessor(object):
               serial=self.reader.GetConfigSerialNo(),
               )
 
-    logging.debug("Sending reply: %s" % reply)
+    logging.debug("Sending reply: %s", reply)
 
     return (reply, rsalt)