Permalink
Browse files

Add test for ResultSet to accomodate non-standard response from OpenS…

…tack. Closes #275.
  • Loading branch information...
1 parent 6e40554 commit 45d00c960cab4289cc99b99e6108674ee43cd849 @garnaat garnaat committed Jul 25, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 boto/ec2/instance.py
@@ -233,7 +233,8 @@ def terminate(self):
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 @@ def stop(self, force=False):
: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])

0 comments on commit 45d00c9

Please sign in to comment.