Make snapshot raise InstanceNotRunning when the instance isn't running.
This commit is contained in:
parent
25ee794d80
commit
b24a05dbc1
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user