summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Garnaat <mitch@garnaat.com>2011-07-25 09:08:02 -0400
committerMitch Garnaat <mitch@garnaat.com>2011-07-25 17:49:12 -0400
commit45d00c960cab4289cc99b99e6108674ee43cd849 (patch)
tree62a37acdcaa1e3ee0320ce16fbfc30866908eff9
parent6e40554ad6f369b00c371ea5ce1a4ce2d64df318 (diff)
downloadboto-45d00c960cab4289cc99b99e6108674ee43cd849.tar.gz
Add test for ResultSet to accomodate non-standard response from OpenStack. Closes #275.
-rw-r--r--boto/ec2/instance.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/boto/ec2/instance.py b/boto/ec2/instance.py
index 8c21bad0..a05d8021 100644
--- a/boto/ec2/instance.py
+++ b/boto/ec2/instance.py
@@ -233,7 +233,8 @@ class Instance(TaggedEC2Object):
Terminate the instance
"""
rs = self.connection.terminate_instances([self.id])
- self._update(rs[0])
+ if len(rs) > 0:
+ self._update(rs[0])
def stop(self, force=False):
"""
@@ -246,14 +247,16 @@ class Instance(TaggedEC2Object):
:return: A list of the instances stopped
"""
rs = self.connection.stop_instances([self.id])
- self._update(rs[0])
+ if len(rs) > 0:
+ self._update(rs[0])
def start(self):
"""
Start the instance.
"""
rs = self.connection.start_instances([self.id])
- self._update(rs[0])
+ if len(rs) > 0:
+ self._update(rs[0])
def reboot(self):
return self.connection.reboot_instances([self.id])