diff options
author | Mitch Garnaat <mitch@garnaat.com> | 2011-07-25 09:08:02 -0400 |
---|---|---|
committer | Mitch Garnaat <mitch@garnaat.com> | 2011-07-25 17:49:12 -0400 |
commit | 45d00c960cab4289cc99b99e6108674ee43cd849 (patch) | |
tree | 62a37acdcaa1e3ee0320ce16fbfc30866908eff9 | |
parent | 6e40554ad6f369b00c371ea5ce1a4ce2d64df318 (diff) | |
download | boto-45d00c960cab4289cc99b99e6108674ee43cd849.tar.gz |
Add test for ResultSet to accomodate non-standard response from OpenStack. Closes #275.
-rw-r--r-- | boto/ec2/instance.py | 9 |
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]) |