Add 'connected' state to please charms_openstack state check

Change-Id: Ia821c381853202ddda6c5ed9e5f17414a8899174
This commit is contained in:
Frode Nordahl 2018-11-18 00:18:51 +01:00
parent ebdb590db7
commit 15a4e6c8ee
No known key found for this signature in database
GPG Key ID: 6A5D59A3BA48373F
2 changed files with 10 additions and 2 deletions

View File

@ -39,11 +39,13 @@ class DashboardPluginRequires(Endpoint):
clear_flag(
self.expand_name(
'endpoint.{endpoint_name}.changed.openstack_dir'))
set_flag(self.expand_name('{endpoint_name}.connected'))
set_flag(self.expand_name('{endpoint_name}.available'))
@when_not('endpoint.{endpoint_name}.joined')
def broken(self):
clear_flag(self.expand_name('{endpoint_name}.available'))
clear_flag(self.expand_name('{endpoint_name}.connected'))
@property
def release(self):

View File

@ -84,12 +84,18 @@ class TestDashboardPluginRequires(test_utils.PatchHelper):
mock.call('endpoint.some-relation.changed.bin_path'),
mock.call('endpoint.some-relation.changed.openstack_dir'),
])
self.set_flag.assert_called_once_with('some-relation.available')
self.set_flag.assert_has_calls([
mock.call('some-relation.connected'),
mock.call('some-relation.available'),
])
def test_broken(self):
self.patch_object(requires, 'clear_flag')
self.dashboard_req.broken()
self.clear_flag.assert_called_once_with('some-relation.available')
self.clear_flag.assert_has_calls([
mock.call('some-relation.available'),
mock.call('some-relation.connected'),
])
def test_publish_plugin_info(self):
to_publish = self.patch_topublish()