From 435c20bd01c895587e6eb059d66e1eb2aff414b4 Mon Sep 17 00:00:00 2001 From: Devananda van der Veen Date: Thu, 7 Aug 2014 14:09:08 -0700 Subject: [PATCH] backport reviewer comments on nova.virt.ironic.patcher Backport comments on the Nova driver review in https://review.openstack.org/#/c/111423/ to Ironic's tree. Change-Id: If5939e3dcc3686046e0fc7989114d25270f034e8 --- ironic/nova/virt/ironic/patcher.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ironic/nova/virt/ironic/patcher.py b/ironic/nova/virt/ironic/patcher.py index 20ad8dc6d1..df00ecf4b4 100644 --- a/ironic/nova/virt/ironic/patcher.py +++ b/ironic/nova/virt/ironic/patcher.py @@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__) def create(node): """Create an instance of the appropriate DriverFields class. - :param node: a dict containing an Ironic node + :param node: a node object returned from ironicclient :returns: GenericDriverFields or a subclass thereof, as appropriate for the supplied node. """ @@ -64,14 +64,14 @@ class GenericDriverFields(object): patch.append({'path': '/instance_info/image_source', 'op': 'add', 'value': image_meta['id']}) patch.append({'path': '/instance_info/root_gb', 'op': 'add', - 'value': str(instance['root_gb'])}) + 'value': str(instance.root_gb)}) patch.append({'path': '/instance_info/swap_mb', 'op': 'add', 'value': str(flavor['swap'])}) - if instance.get('ephemeral_gb'): + if instance.ephemeral_gb: patch.append({'path': '/instance_info/ephemeral_gb', 'op': 'add', - 'value': str(instance['ephemeral_gb'])}) + 'value': str(instance.ephemeral_gb)}) if CONF.default_ephemeral_format: patch.append({'path': '/instance_info/ephemeral_format', 'op': 'add',