From b4dfed68eefd941fdee14cdca9d635783361677d Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 19 Nov 2014 13:17:50 -0800 Subject: [PATCH] Fix use of extract_flavor() in hyper-v driver This converts a use of extract_flavor() in the hyper-v driver to instance.get_flavor(). Related to blueprint flavor-from-sysmeta-to-blob Change-Id: I91d568e6eb97965bd4f406d0c0f047011ec50b78 --- nova/virt/hyperv/imagecache.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nova/virt/hyperv/imagecache.py b/nova/virt/hyperv/imagecache.py index 07e7ddb812a2..36673ac0fb4e 100644 --- a/nova/virt/hyperv/imagecache.py +++ b/nova/virt/hyperv/imagecache.py @@ -21,7 +21,6 @@ from oslo.config import cfg from oslo.utils import excutils from oslo.utils import units -from nova.compute import flavors from nova.i18n import _ from nova.openstack.common import log as logging from nova import utils @@ -43,9 +42,8 @@ class ImageCache(object): def _get_root_vhd_size_gb(self, instance): try: # In case of resizes we need the old root disk size - old_flavor = flavors.extract_flavor( - instance, prefix='old_') - return old_flavor['root_gb'] + old_flavor = instance.get_flavor('old') + return old_flavor.root_gb except KeyError: return instance['root_gb']