<s> from oslo_serialization import jsonutils <EOL> from oslo_utils import uuidutils <EOL> from nova import context <EOL> from nova import objects <EOL> from nova . tests . unit import fake_flavor <EOL> INSTANCE_NUMA_TOPOLOGY = objects . InstanceNUMATopology ( <EOL> cells = [ objects . InstanceNUMACell ( id = <NUM_LIT:0> , cpuset = set ( [ <NUM_LIT:1> , <NUM_LIT:2> ] ) , memory = <NUM_LIT> ) , <EOL> objects . InstanceNUMACell ( id = <NUM_LIT:1> , cpuset = set ( [ <NUM_LIT:3> , <NUM_LIT:4> ] ) , memory = <NUM_LIT> ) ] ) <EOL> INSTANCE_NUMA_TOPOLOGY . obj_reset_changes ( recursive = True ) <EOL> IMAGE_META = objects . ImageMeta . from_dict ( <EOL> { '<STR_LIT:status>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:0> , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:yes>' , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:yes>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT:size>' : <NUM_LIT> , <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:id>' : '<STR_LIT>' , <EOL> } <EOL> ) <EOL> IMAGE_META . obj_reset_changes ( recursive = True ) <EOL> PCI_REQUESTS = objects . InstancePCIRequests ( <EOL> requests = [ objects . InstancePCIRequest ( count = <NUM_LIT:1> ) , <EOL> objects . InstancePCIRequest ( count = <NUM_LIT:2> ) ] ) <EOL> PCI_REQUESTS . obj_reset_changes ( recursive = True ) <EOL> def fake_db_spec ( ) : <EOL> req_obj = fake_spec_obj ( ) <EOL> db_request_spec = { <EOL> '<STR_LIT:id>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : req_obj . instance_uuid , <EOL> '<STR_LIT>' : jsonutils . dumps ( req_obj . obj_to_primitive ( ) ) , <EOL> } <EOL> return db_request_spec <EOL> def fake_spec_obj ( remove_id = False ) : <EOL> ctxt = context . RequestContext ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> req_obj = objects . RequestSpec ( ctxt ) <EOL> if not remove_id : <EOL> req_obj . id = <NUM_LIT> <EOL> req_obj . instance_uuid = uuidutils . generate_uuid ( ) <EOL> req_obj . image = IMAGE_META <EOL> req_obj . numa_topology = INSTANCE_NUMA_TOPOLOGY <EOL> req_obj . pci_requests = PCI_REQUESTS <EOL> req_obj . flavor = fake_flavor . fake_flavor_obj ( ctxt ) <EOL> req_obj . retry = objects . SchedulerRetries ( ) <EOL> req_obj . limits = objects . SchedulerLimits ( ) <EOL> req_obj . instance_group = objects . InstanceGroup ( ) <EOL> req_obj . project_id = '<STR_LIT>' <EOL> req_obj . num_instances = <NUM_LIT:1> <EOL> req_obj . availability_zone = None <EOL> req_obj . ignore_hosts = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> req_obj . force_hosts = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> req_obj . force_nodes = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> req_obj . scheduler_hints = { '<STR_LIT>' : [ '<STR_LIT>' ] } <EOL> req_obj . obj_reset_changes ( [ '<STR_LIT:id>' ] ) <EOL> return req_obj </s>
