Observe reality for OS::Keystone::Domain

Change-Id: I73f97b23d0f2d3e8bd3e0a64041d8cc912e57245
implements: blueprint get-reality-for-resources
changes/60/395960/1
Kanagaraj Manickam 6 years ago
parent 87d0ca5509
commit 0ab60b0e38

@ -90,6 +90,11 @@ class KeystoneDomain(resource.Resource):
enabled=enabled
)
def parse_live_resource_data(self, resource_properties, resource_data):
return {self.NAME: resource_data.get(self.NAME),
self.DESCRIPTION: resource_data.get(self.DESCRIPTION),
self.ENABLED: resource_data.get(self.ENABLED)}
def resource_mapping():
return {

@ -114,3 +114,16 @@ class KeystoneDomainTest(common.HeatTestCase):
enabled=prop_diff[domain.KeystoneDomain.ENABLED],
name='test_domain_2'
)
def test_get_live_state(self):
sample_domain = {
domain.KeystoneDomain.NAME: 'test',
domain.KeystoneDomain.ENABLED: True,
domain.KeystoneDomain.DESCRIPTION: 'test domain'
}
d = mock.Mock()
d.to_dict.return_value = sample_domain
self.domains.get.return_value = d
reality = self.test_domain.get_live_state(self.test_domain.properties)
self.assertEqual(sample_domain, reality)

Loading…
Cancel
Save