diff options
author | Wangpan <hzwangpan@corp.netease.com> | 2014-02-17 11:27:22 +0800 |
---|---|---|
committer | Wangpan <hzwangpan@corp.netease.com> | 2014-03-13 13:46:58 +0800 |
commit | c87a88f0a531effeff571c2aa014e629e8299564 (patch) | |
tree | 15ca08920fb43db424fe6bbc6ed812e822d53dcd | |
parent | 1b790cc59720edd0cc77b3b5fb2114ce4c56b1ce (diff) | |
download | nova-c87a88f0a531effeff571c2aa014e629e8299564.tar.gz |
Fix InstanceNotFound error in _delete_instance_files
Currently the cleanup_running_deleted_instances peroidic task
failed with InstanceNotFound exception, this is because the
db query is not including the deleted instance while
_delete_instance_files() in libvirt driver.
Closes-bug: #1280140
Change-Id: Ie65ff255ad3c582a71db93b07304a21d4976a193
(cherry picked from d835163759527a651f3c4f2109ca0fdc3e968d37)
-rw-r--r-- | nova/virt/libvirt/driver.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index c78605526b..34f4f42b2c 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -4758,7 +4758,7 @@ class LibvirtDriver(driver.ComputeDriver): def _delete_instance_files(self, instance): # NOTE(mikal): a shim to handle this file not using instance objects # everywhere. Remove this when that conversion happens. - context = nova_context.get_admin_context() + context = nova_context.get_admin_context(read_deleted='yes') inst_obj = instance_obj.Instance.get_by_uuid(context, instance['uuid']) # NOTE(mikal): this code should be pushed up a layer when this shim is |