Access DB values as dict not as attributes. Part 2
We cannot assume nova.db.api will be returning sqlalchemy objects with attributes, instead treat return values as dicts Part of blueprint db-api-cleanup Change-Id: I39ccd2f110c258d69bb2d4d7078c672c6a6ef36e
This commit is contained in:
@@ -771,7 +771,7 @@ class HostFiltersTestCase(test.TestCase):
|
||||
'availability_zone': 'fake_avail_zone', }
|
||||
result = db.aggregate_create(self.context.elevated(), values, metadata)
|
||||
for host in hosts:
|
||||
db.aggregate_host_add(self.context.elevated(), result.id, host)
|
||||
db.aggregate_host_add(self.context.elevated(), result['id'], host)
|
||||
return result
|
||||
|
||||
def _do_test_aggregate_filter_extra_specs(self, emeta, especs, passes):
|
||||
@@ -797,7 +797,7 @@ class HostFiltersTestCase(test.TestCase):
|
||||
{'memory_mb': 1024, 'extra_specs': extra_specs}}
|
||||
host = fakes.FakeHostState('host1', 'node1',
|
||||
{'free_ram_mb': 1024})
|
||||
db.aggregate_host_delete(self.context.elevated(), agg2.id, 'host1')
|
||||
db.aggregate_host_delete(self.context.elevated(), agg2['id'], 'host1')
|
||||
self.assertFalse(filt_cls.host_passes(host, filter_properties))
|
||||
|
||||
def test_aggregate_filter_passes_extra_specs_simple(self):
|
||||
|
||||
Reference in New Issue
Block a user