Merge "InstanceNUMAToplogy object create remove uuid param"
This commit is contained in:
commit
eccc42d496
@ -350,7 +350,8 @@ class Instance(base.NovaPersistentObject, base.NovaObject):
|
|||||||
db_inst = db.instance_create(context, updates)
|
db_inst = db.instance_create(context, updates)
|
||||||
if numa_topology:
|
if numa_topology:
|
||||||
expected_attrs.append('numa_topology')
|
expected_attrs.append('numa_topology')
|
||||||
numa_topology.create(context, db_inst['uuid'])
|
numa_topology.instance_uuid = db_inst['uuid']
|
||||||
|
numa_topology.create(context)
|
||||||
self._from_db_object(context, self, db_inst, expected_attrs)
|
self._from_db_object(context, self, db_inst, expected_attrs)
|
||||||
|
|
||||||
@base.remotable
|
@base.remotable
|
||||||
|
@ -62,14 +62,14 @@ class InstanceNUMATopology(base.NovaObject):
|
|||||||
return hardware.VirtNUMAInstanceTopology(cells=cells)
|
return hardware.VirtNUMAInstanceTopology(cells=cells)
|
||||||
|
|
||||||
@base.remotable
|
@base.remotable
|
||||||
def create(self, context, instance_uuid):
|
def create(self, context):
|
||||||
if self.obj_attr_is_set('id'):
|
if self.obj_attr_is_set('id'):
|
||||||
raise exception.ObjectActionError(action='create',
|
raise exception.ObjectActionError(action='create',
|
||||||
reason='already created')
|
reason='already created')
|
||||||
topology = self.topology_from_obj()
|
topology = self.topology_from_obj()
|
||||||
if not topology:
|
if not topology:
|
||||||
return
|
return
|
||||||
values = {'instance_uuid': instance_uuid,
|
values = {'instance_uuid': self.instance_uuid,
|
||||||
'numa_topology': topology.to_json()}
|
'numa_topology': topology.to_json()}
|
||||||
db_object = db.instance_extra_create(context, values)
|
db_object = db.instance_extra_create(context, values)
|
||||||
self.instance_uuid = db_object['instance_uuid']
|
self.instance_uuid = db_object['instance_uuid']
|
||||||
|
@ -38,7 +38,8 @@ class _TestInstanceNUMATopology(object):
|
|||||||
def test_create(self):
|
def test_create(self):
|
||||||
topo_obj = objects.InstanceNUMATopology.obj_from_topology(
|
topo_obj = objects.InstanceNUMATopology.obj_from_topology(
|
||||||
fake_numa_topology)
|
fake_numa_topology)
|
||||||
topo_obj.create(self.context, fake_db_topology['instance_uuid'])
|
topo_obj.instance_uuid = fake_db_topology['instance_uuid']
|
||||||
|
topo_obj.create(self.context)
|
||||||
got = objects.InstanceNUMATopology.get_by_instance_uuid(
|
got = objects.InstanceNUMATopology.get_by_instance_uuid(
|
||||||
self.context, fake_db_topology['instance_uuid'])
|
self.context, fake_db_topology['instance_uuid'])
|
||||||
self.assertIsNotNone(got)
|
self.assertIsNotNone(got)
|
||||||
|
@ -961,7 +961,7 @@ object_data = {
|
|||||||
'InstanceInfoCache': '1.5-ef64b604498bfa505a8c93747a9d8b2f',
|
'InstanceInfoCache': '1.5-ef64b604498bfa505a8c93747a9d8b2f',
|
||||||
'InstanceList': '1.8-16db4c93fe5b80564413b9a4f547e0d1',
|
'InstanceList': '1.8-16db4c93fe5b80564413b9a4f547e0d1',
|
||||||
'InstanceNUMACell': '1.0-17e6ee0a24cb6651d1b084efa3027bda',
|
'InstanceNUMACell': '1.0-17e6ee0a24cb6651d1b084efa3027bda',
|
||||||
'InstanceNUMATopology': '1.0-a4264388d42c21a692cb74ed8fa8bb4d',
|
'InstanceNUMATopology': '1.0-86b95d263c4c68411d44c6741b8d2bb0',
|
||||||
'KeyPair': '1.1-3410f51950d052d861c11946a6ae621a',
|
'KeyPair': '1.1-3410f51950d052d861c11946a6ae621a',
|
||||||
'KeyPairList': '1.0-71132a568cc5d078ba1748a9c02c87b8',
|
'KeyPairList': '1.0-71132a568cc5d078ba1748a9c02c87b8',
|
||||||
'Migration': '1.1-67c47726c2c71422058cd9d149d6d3ed',
|
'Migration': '1.1-67c47726c2c71422058cd9d149d6d3ed',
|
||||||
|
Loading…
Reference in New Issue
Block a user