From c32ad364e52971d7cce9c91da74d6336bde88e30 Mon Sep 17 00:00:00 2001 From: jichenjc Date: Fri, 22 May 2015 11:54:09 +0800 Subject: [PATCH] conductor: update comments for rpc and use object The flavor are objects in conductor now, so this patch use comma directly. Also, because conductor still has 1.x RPC support, change the comments of flavor shim from 'Remove this in version 2.0 of the RPC API' to 'Remove this when we drop support for v1 of the RPC API' Related to blueprint liberty-objects Change-Id: I129e8641a4952d7dde2ed93a7170c1cb6f4da44a --- nova/conductor/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/conductor/manager.py b/nova/conductor/manager.py index dc4742380cf4..3d37d2672f9c 100644 --- a/nova/conductor/manager.py +++ b/nova/conductor/manager.py @@ -523,7 +523,7 @@ class ComputeTaskManager(base.Base): instance = objects.Instance._from_db_object( context, objects.Instance(), instance, expected_attrs=attrs) - # NOTE(melwitt): Remove this in version 2.0 of the RPC API + # NOTE: Remove this when we drop support for v1 of the RPC API if flavor and not isinstance(flavor, objects.Flavor): # Code downstream may expect extra_specs to be populated since it # is receiving an object, so lookup the flavor to ensure this. @@ -563,7 +563,7 @@ class ComputeTaskManager(base.Base): updates, ex, request_spec) # if the flavor IDs match, it's migrate; otherwise resize - if flavor['id'] == instance.instance_type_id: + if flavor.id == instance.instance_type_id: msg = _("No valid host found for cold migrate") else: msg = _("No valid host found for resize")