diff options
| author | Soren Hansen <soren@linux2go.dk> | 2011-08-22 23:25:08 +0200 |
|---|---|---|
| committer | Soren Hansen <soren@linux2go.dk> | 2011-08-22 23:25:08 +0200 |
| commit | b24a05dbc19eaf67661eac98aa778d789ffa7b4e (patch) | |
| tree | c2d08a23e55d426e90a5bc35f738a951e7c10361 /nova/virt | |
| parent | 25ee794d803fa522d31177dc16d8c535d9b8daab (diff) | |
| download | nova-b24a05dbc19eaf67661eac98aa778d789ffa7b4e.tar.gz nova-b24a05dbc19eaf67661eac98aa778d789ffa7b4e.tar.xz nova-b24a05dbc19eaf67661eac98aa778d789ffa7b4e.zip | |
Make snapshot raise InstanceNotRunning when the instance isn't running.
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/fake.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/virt/fake.py b/nova/virt/fake.py index e1e909c42..d5e2bf31b 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -100,7 +100,8 @@ class FakeConnection(driver.ComputeDriver): self.instances[name] = fake_instance def snapshot(self, context, instance, name): - pass + if not instance['name'] in self.instances: + raise exception.InstanceNotRunning() def reboot(self, instance, network_info): pass @@ -145,7 +146,7 @@ class FakeConnection(driver.ComputeDriver): pass def destroy(self, instance, network_info, cleanup=True): - key = instance.name + key = instance['name'] if key in self.instances: del self.instances[key] else: |
