Revision 07b8a2b5

b/daemons/ganeti-confd
67 67
    self.port = port
68 68
    self.processor = processor
69 69
    self.bind((bind_address, port))
70
    logging.debug("listening on ('%s':%d)" % (bind_address, port))
70
    logging.debug("listening on ('%s':%d)", bind_address, port)
71 71

  
72 72
  # this method is overriding a daemon.AsyncUDPSocket method
73 73
  def handle_datagram(self, payload_in, ip, port):
......
134 134
    # IN_IGNORED event from inotify, because of the file removal (which is
135 135
    # contextual with the replacement). In such a case we need to create
136 136
    # another watcher for the "new" file.
137
    logging.debug("Received 'ignored' inotify event for %s" % event.path)
137
    logging.debug("Received 'ignored' inotify event for %s", event.path)
138 138
    self.watch_handle = None
139 139

  
140 140
    try:
......
144 144
      # going to realod the file after setting up the new watch.
145 145
      self.callback(False)
146 146
    except errors.ConfdFatalError, err:
147
      logging.critical("Critical error, shutting down: %s" % err)
147
      logging.critical("Critical error, shutting down: %s", err)
148 148
      sys.exit(constants.EXIT_FAILURE)
149 149
    except:
150 150
      # we need to catch any exception here, log it, but proceed, because even
......
157 157
    # usually happen in Ganeti, as the config file is normally replaced by a
158 158
    # new one, at filesystem level, rather than actually modified (see
159 159
    # utils.WriteFile)
160
    logging.debug("Received 'modify' inotify event for %s" % event.path)
160
    logging.debug("Received 'modify' inotify event for %s", event.path)
161 161

  
162 162
    try:
163 163
      self.callback(True)
164 164
    except errors.ConfdFatalError, err:
165
      logging.critical("Critical error, shutting down: %s" % err)
165
      logging.critical("Critical error, shutting down: %s", err)
166 166
      sys.exit(constants.EXIT_FAILURE)
167 167
    except:
168 168
      # we need to catch any exception here, log it, but proceed, because even
......
171 171
      logging.error("Unexpected exception", exc_info=True)
172 172

  
173 173
  def process_default(self, event):
174
    logging.error("Received unhandled inotify event: %s" % event)
174
    logging.error("Received unhandled inotify event: %s", event)
175 175

  
176 176

  
177 177
class ConfdConfigurationReloader(object):
b/daemons/ganeti-watcher
331 331

  
332 332
    """
333 333
    arch_count, left_count = client.AutoArchiveJobs(age)
334
    logging.debug("Archived %s jobs, left %s" % (arch_count, left_count))
334
    logging.debug("Archived %s jobs, left %s", arch_count, left_count)
335 335

  
336 336
  def CheckDisks(self, notepad):
337 337
    """Check all nodes for restarted ones.
b/lib/confd/querylib.py
201 201
      network_link = None
202 202
      mode = constants.CONFD_REQQ_IP
203 203
    else:
204
      logging.debug("Invalid query argument type for: %s" % query)
204
      logging.debug("Invalid query argument type for: %s", query)
205 205
      return QUERY_ARGUMENT_ERROR
206 206

  
207 207
    pnodes_list = []
208 208

  
209 209
    for instance_ip in instances_list:
210 210
      if not isinstance(instance_ip, basestring):
211
        logging.debug("Invalid IP type for: %s" % instance_ip)
211
        logging.debug("Invalid IP type for: %s", instance_ip)
212 212
        return QUERY_ARGUMENT_ERROR
213 213

  
214 214
      instance = self.reader.GetInstanceByLinkIp(instance_ip, network_link)
215 215
      if not instance:
216
        logging.debug("Unknown instance IP: %s" % instance_ip)
216
        logging.debug("Unknown instance IP: %s", instance_ip)
217 217
        pnodes_list.append(QUERY_UNKNOWN_ENTRY_ERROR)
218 218
        continue
219 219

  
220 220
      pnode = self.reader.GetInstancePrimaryNode(instance)
221 221
      if not pnode:
222 222
        logging.error("Instance '%s' doesn't have an associated primary"
223
                      " node" % instance)
223
                      " node", instance)
224 224
        pnodes_list.append(QUERY_INTERNAL_ERROR)
225 225
        continue
226 226

  
227 227
      pnode_primary_ip = self.reader.GetNodePrimaryIp(pnode)
228 228
      if not pnode_primary_ip:
229 229
        logging.error("Primary node '%s' doesn't have an associated"
230
                      " primary IP" % pnode)
230
                      " primary IP", pnode)
231 231
        pnodes_list.append(QUERY_INTERNAL_ERROR)
232 232
        continue
233 233

  
234 234
      pnodes_list.append((constants.CONFD_REPL_STATUS_OK, pnode_primary_ip))
235 235

  
236
    # If a single ip was requested, return a single answer, otherwise the whole
237
    # list, with a success status (since each entry has its own success/failure)
236
    # If a single ip was requested, return a single answer, otherwise
237
    # the whole list, with a success status (since each entry has its
238
    # own success/failure)
238 239
    if mode == constants.CONFD_REQQ_IP:
239 240
      return pnodes_list[0]
240 241

  
b/lib/confd/server.py
100 100
      payload_out = self.PackReply(reply, rsalt)
101 101
      return payload_out
102 102
    except errors.ConfdRequestError, err:
103
      logging.info('Ignoring broken query from %s:%d: %s' % (ip, port, err))
103
      logging.info('Ignoring broken query from %s:%d: %s', ip, port, err)
104 104
      return None
105 105

  
106 106
  def ExtractRequest(self, payload):
......
110 110

  
111 111
    """
112 112
    current_time = time.time()
113
    logging.debug("Extracting request with size: %d" % (len(payload)))
113
    logging.debug("Extracting request with size: %d", len(payload))
114 114
    try:
115 115
      (message, salt) = serializer.LoadSigned(payload, self.hmac_key)
116 116
    except errors.SignatureError, err:
......
142 142
    @return: tuple of reply and salt to add to the signature
143 143

  
144 144
    """
145
    logging.debug("Processing request: %s" % request)
145
    logging.debug("Processing request: %s", request)
146 146
    if request.protocol != constants.CONFD_PROTOCOL_VERSION:
147 147
      msg = "wrong protocol version %d" % request.protocol
148 148
      raise errors.ConfdRequestError(msg)
......
165 165
              serial=self.reader.GetConfigSerialNo(),
166 166
              )
167 167

  
168
    logging.debug("Sending reply: %s" % reply)
168
    logging.debug("Sending reply: %s", reply)
169 169

  
170 170
    return (reply, rsalt)
171 171

  
b/lib/hypervisor/hv_kvm.py
376 376
            vnc_arg = '%s:%d' % (vnc_bind_address, display)
377 377
        else:
378 378
          logging.error("Network port is not a valid VNC display (%d < %d)."
379
                        " Not starting VNC" %
380
                        (instance.network_port,
381
                         constants.VNC_BASE_PORT))
379
                        " Not starting VNC", instance.network_port,
380
                        constants.VNC_BASE_PORT)
382 381
          vnc_arg = 'none'
383 382

  
384 383
        # Only allow tls and other option when not binding to a file, for now.
......
686 685
          raise errors.HypervisorError("Migration %s at the kvm level" %
687 686
                                       status)
688 687
        else:
689
          logging.info("KVM: unknown migration status '%s'" % status)
688
          logging.info("KVM: unknown migration status '%s'", status)
690 689
          time.sleep(2)
691 690

  
692 691
    utils.KillProcess(pid)
b/tools/cfgupgrade
198 198
    if vrfy:
199 199
      logging.error("Errors after conversion:")
200 200
      for item in vrfy:
201
        logging.error(" - %s" % item)
201
        logging.error(" - %s", item)
202 202
    del cfg
203 203
    logging.info("File loaded successfully")
204 204

  

Also available in: Unified diff