diff options
| author | Mohammed Naser <mnaser@vexxhost.com> | 2011-07-25 21:14:08 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-07-25 21:14:08 +0000 |
| commit | eba9e4abd6271e0265899a2d260b54068d78ee51 (patch) | |
| tree | d824c97c73f345cf67c6c0ee60df6d5671ed4431 /nova | |
| parent | 335476d1835a511d824a165301adace01766bf3b (diff) | |
| parent | 67ccc98d6a0d9e8618889fd9fa398a39735d044a (diff) | |
Fixes a typo in rescue instance in ec2 api. This is mnaser's fix, I just added a test to verify the change.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/api/ec2/cloud.py | 2 | ||||
| -rw-r--r-- | nova/tests/test_cloud.py | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 16ca1ed2a..4bb473765 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -1147,7 +1147,7 @@ class CloudController(object): def rescue_instance(self, context, instance_id, **kwargs): """This is an extension to the normal ec2_api""" - self._do_instance(self.compute_api.rescue, contect, instnace_id) + self._do_instance(self.compute_api.rescue, context, instance_id) return True def unrescue_instance(self, context, instance_id, **kwargs): diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py index 8cdc73a66..6e64d61ac 100644 --- a/nova/tests/test_cloud.py +++ b/nova/tests/test_cloud.py @@ -908,6 +908,21 @@ class CloudTestCase(test.TestCase): self._wait_for_running(ec2_instance_id) return ec2_instance_id + def test_rescue_unrescue_instance(self): + instance_id = self._run_instance( + image_id='ami-1', + instance_type=FLAGS.default_instance_type, + max_count=1) + self.cloud.rescue_instance(context=self.context, + instance_id=instance_id) + # NOTE(vish): This currently does no validation, it simply makes sure + # that the code path doesn't throw an exception. + self.cloud.unrescue_instance(context=self.context, + instance_id=instance_id) + # TODO(soren): We need this until we can stop polling in the rpc code + # for unit tests. + self.cloud.terminate_instances(self.context, [instance_id]) + def test_console_output(self): instance_id = self._run_instance( image_id='ami-1', |
