Merge "Fix use of extract_flavor() in hyper-v driver"

This commit is contained in:
Jenkins
2014-11-26 17:18:40 +00:00
committed by Gerrit Code Review

View File

@@ -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']