[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 d701831fb8835ccd4095ed0e00e7c97dc5df98a9
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Tue Jan 8 14:32:33 2013 -0800
Print previous, current states when terminating
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-109
diff --git a/euca2ools/commands/euca/terminateinstances.py b/euca2ools/commands/euca/terminateinstances.py
index cae64e8..31a5761 100644
--- a/euca2ools/commands/euca/terminateinstances.py
+++ b/euca2ools/commands/euca/terminateinstances.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
@@ -43,8 +44,14 @@ class TerminateInstances(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, 'terminate_instances',
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list