def _fake_migration_create(self, context, values=None): instance_uuid = str(uuid.uuid1()) mig_dict = test_migration.fake_db_migration() mig_dict.update( { "id": 1, "source_compute": "host1", "source_node": "fakenode", "dest_compute": "host2", "dest_node": "fakenode", "dest_host": "127.0.0.1", "old_instance_type_id": 1, "new_instance_type_id": 2, "instance_uuid": instance_uuid, "status": "pre-migrating", "updated_at": timeutils.utcnow(), } ) if values: mig_dict.update(values) migration = objects.Migration() migration.update(mig_dict) # This hits the stub in setUp() migration.create("fake")
def _fake_migration_create(self, context, values=None): instance_uuid = str(uuid.uuid1()) mig_dict = test_migration.fake_db_migration() mig_dict.update({ 'id': 1, 'source_compute': 'host1', 'source_node': 'fakenode', 'dest_compute': 'host2', 'dest_node': 'fakenode', 'dest_host': '127.0.0.1', 'old_instance_type_id': 1, 'new_instance_type_id': 2, 'instance_uuid': instance_uuid, 'status': 'pre-migrating', 'updated_at': timeutils.utcnow() }) if values: mig_dict.update(values) migration = migration_obj.Migration() migration.update(mig_dict) # This hits the stub in setUp() migration.create('fake')