[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, experimental, updated. debian/2.1.3-1_experimental1

Garrett Holmstrom gholms at fedoraproject.org
Sat Mar 16 03:26:39 UTC 2013


The following commit has been merged in the experimental branch:
commit 2d257ca0e63a1e9b9c9bfe82ecde70bb881b067d
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Tue Jan 8 14:45:38 2013 -0800

    Print previous, current states when stopping
    
    This requires boto 2.6 or a patched version that includes the fix that
    appears in boto commit a23c379 due to boto bug 889.  When that fix is
    not present the tool will fall back to the old output format that does
    not include instance states.
    
    Fixes TOOLS-176

diff --git a/euca2ools/commands/euca/stopinstances.py b/euca2ools/commands/euca/stopinstances.py
index a63a0ae..3573ba2 100644
--- a/euca2ools/commands/euca/stopinstances.py
+++ b/euca2ools/commands/euca/stopinstances.py
@@ -31,6 +31,7 @@
 # Author: Neil Soman neil at eucalyptus.com
 #         Mitch Garnaat mgarnaat at eucalyptus.com
 
+import boto.ec2.instance
 import euca2ools.commands.eucacommand
 from boto.roboto.param import Param
 
@@ -46,8 +47,14 @@ class StopInstances(euca2ools.commands.eucacommand.EucaCommand):
 
     def display_instances(self, instances):
         for instance in instances:
-            print 'INSTANCE\t%s' % instance.id
-            
+            if 'InstanceState' in dir(boto.ec2.instance):
+                # See https://eucalyptus.atlassian.net/browse/TOOLS-109
+                print 'INSTANCE\t%s\t%s\t%s' % (instance.id,
+                                                instance.previous_state,
+                                                instance.state)
+            else:
+                print 'INSTANCE\t%s' % instance.id
+
     def main(self):
         conn = self.make_connection_cli()
         return self.make_request_cli(conn, 'stop_instances',

-- 
managing cloud instances for Eucalyptus



More information about the pkg-eucalyptus-commits mailing list