Revision f4bc1f2c daemons/ganeti-watcher

b/daemons/ganeti-watcher
122 122
    except Exception, msg:
123 123
      # Ignore errors while loading the file and treat it as empty
124 124
      self.data = {}
125
      sys.stderr.write("Empty or invalid state file. "
126
          "Using defaults. Error message: %s\n" % msg)
125
      sys.stderr.write("Empty or invalid state file."
126
                       " Using defaults. Error message: %s\n" % msg)
127 127

  
128 128
    if "instance" not in self.data:
129 129
      self.data["instance"] = {}
......
367 367
      # secondary node.
368 368
      for instance in GetInstanceList(with_secondaries=check_nodes):
369 369
        try:
370
          self.messages.append(Message(NOTICE,
371
                                       "Activating disks for %s." %
372
                                       instance.name))
370
          self.messages.append(Message(NOTICE, ("Activating disks for %s." %
371
                                                instance.name)))
373 372
          instance.ActivateDisks()
374 373
        except Error, x:
375 374
          self.messages.append(Message(ERROR, str(x)))
......
402 401
                                       (instance.name, MAXTRIES)))
403 402
          continue
404 403
        try:
405
          self.messages.append(Message(NOTICE,
406
                                       "Restarting %s%s." %
407
                                       (instance.name, last)))
404
          self.messages.append(Message(NOTICE, ("Restarting %s%s." %
405
                                                (instance.name, last))))
408 406
          instance.Restart()
409 407
        except Error, x:
410 408
          self.messages.append(Message(ERROR, str(x)))
......
416 414
      else:
417 415
        if notepad.NumberOfRestartAttempts(instance):
418 416
          notepad.RemoveInstance(instance)
419
          msg = Message(NOTICE,
420
                        "Restart of %s succeeded." % instance.name)
417
          msg = Message(NOTICE, "Restart of %s succeeded." % instance.name)
421 418
          self.messages.append(msg)
422 419

  
423 420
  def WriteReport(self, logfile):

Also available in: Unified diff