diff options
author | Matt Riedemann <mriedem@us.ibm.com> | 2013-12-15 12:57:46 -0800 |
---|---|---|
committer | Matt Riedemann <mriedem@us.ibm.com> | 2013-12-17 18:26:02 -0800 |
commit | 9162d2b984ccca2ebadbcb9098962af648c1bd50 (patch) | |
tree | a0dbe505b5016f5bfe103947313c79ab1908036a /nova/utils.py | |
parent | 61d1ac502587ccae51a90d0cdf77d148d17b0506 (diff) | |
download | nova-9162d2b984ccca2ebadbcb9098962af648c1bd50.tar.gz |
Rename instance_type to flavor in nova.utils and nova.compute.utils
Renames 'instance_type' to 'flavor' in nova.utils and nova.compute.utils
and related tests. Removes the unused fake_get method in
test_compute_utils.
Note that the nova.notifications payload isn't updated yet to store
flavor instead of instance_type so this patch still uses
payload['instance_type'] when processing the notification in
test_compute_utils.
Note that instance_type_id and the instance_type_* keys in
system_metadata are part of the data model and would require a database
migration to change, so those are not part of this patch.
Part of blueprint flavor-instance-type-dedup
Change-Id: I56815e5c8238f8e4ad4e3a2a599310da2b7f4568
Diffstat (limited to 'nova/utils.py')
-rw-r--r-- | nova/utils.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/utils.py b/nova/utils.py index ea738d4178..e1cf05a91c 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -1096,7 +1096,7 @@ def get_auto_disk_config_from_image_props(image_properties): return image_properties.get("auto_disk_config") -def get_system_metadata_from_image(image_meta, instance_type=None): +def get_system_metadata_from_image(image_meta, flavor=None): system_meta = {} prefix_format = SM_IMAGE_PROP_PREFIX + '%s' @@ -1107,11 +1107,11 @@ def get_system_metadata_from_image(image_meta, instance_type=None): for key in SM_INHERITABLE_KEYS: value = image_meta.get(key) - if key == 'min_disk' and instance_type: + if key == 'min_disk' and flavor: if image_meta.get('disk_format') == 'vhd': - value = instance_type['root_gb'] + value = flavor['root_gb'] else: - value = max(value, instance_type['root_gb']) + value = max(value, flavor['root_gb']) if value is None: continue |