ShutdownInstance: log instance name, not object
authorGuido Trotter <ultrotter@google.com>
Wed, 21 Jan 2009 18:23:59 +0000 (18:23 +0000)
committerGuido Trotter <ultrotter@google.com>
Wed, 21 Jan 2009 18:23:59 +0000 (18:23 +0000)
When an instance fails to shut down we currently log its whole object,
rather than just the instance name.

Reviewed-by: iustinp

lib/backend.py

index 3a86cbb..7bcf6e1 100644 (file)
@@ -909,7 +909,8 @@ def ShutdownInstance(instance):
     time.sleep(10)
   else:
     # the shutdown did not succeed
-    logging.error("shutdown of '%s' unsuccessful, using destroy", instance)
+    logging.error("Shutdown of '%s' unsuccessful, using destroy",
+                  instance.name)
 
     try:
       hyper.StopInstance(instance, force=True)
@@ -919,7 +920,7 @@ def ShutdownInstance(instance):
 
     time.sleep(1)
     if instance.name in GetInstanceList([hv_name]):
-      logging.error("could not shutdown instance '%s' even by destroy",
+      logging.error("Could not shutdown instance '%s' even by destroy",
                     instance.name)
       return False