Merge "remove dependancy on nova object model"

This commit is contained in:
Jenkins 2016-01-22 02:37:18 +00:00 committed by Gerrit Code Review
commit 0cbb4e634d
2 changed files with 4 additions and 7 deletions

View File

@ -41,7 +41,10 @@ argument of type `os_vif.objects.VIF`::
instance_uuid = 'd7a730ca-3c28-49c3-8f26-4662b909fe8a'
instance = nova_objects.Instance.get_by_uuid(instance_uuid)
instance_info = vif_objects.InstanceInfo.from_nova_instance(instance)
instance_info = vif_objects.InstanceInfo(
uuid=instance.uuid,
name=instance.name,
project_id=instance.project_id)
subnet = vif_objects.Subnet(cidr='192.168.1.0/24')
subnets = vif_objects.SubnetList([subnet])

View File

@ -29,9 +29,3 @@ class InstanceInfo(base.VersionedObject):
# The project/tenant ID that owns the instance
'project_id': fields.StringField(),
}
@classmethod
def from_nova_instance(cls, instance):
return cls(uuid=instance.uuid,
name=instance.name,
project_id=instance.project_id)