Exemplo n.º 1
0
 def test_host_update(self):
     update = {'name': 'updated_name', 'type': 'updated_type'}
     updated = {'uuid': uuidsentinel.fake_uuid,
                'name': 'updated_name',
                'reserved': True,
                'type': 'updated_type',
                'control_attributes': 'fake_control_attr',
                'failover_segment': self.failover_segment,
                'failover_segment_id': uuidsentinel.failover_segment_id,
                'on_maintenance': True}
     ignored_keys = ['deleted', 'created_at', 'updated_at', 'deleted_at',
                     'id', 'failover_segment']
     self._create_host(self._get_fake_values())
     db.host_update(self.ctxt, uuidsentinel.fake_uuid, update)
     host_updated = db.host_get_by_uuid(self.ctxt, uuidsentinel.fake_uuid)
     self._assertEqualObjects(updated, host_updated, ignored_keys)
     self.assertEqual(updated['failover_segment'].items(),
                      host_updated['failover_segment'].items())
Exemplo n.º 2
0
 def get_by_uuid(cls, context, uuid, segment_uuid=None):
     db_inst = db.host_get_by_uuid(context, uuid, segment_uuid=segment_uuid)
     return cls._from_db_object(context, cls(), db_inst)
Exemplo n.º 3
0
 def get_by_uuid(cls, context, uuid, segment_uuid=None):
     db_inst = db.host_get_by_uuid(context, uuid, segment_uuid=segment_uuid)
     return cls._from_db_object(context, cls(), db_inst)