diff --git a/src/reactive/designate_handlers.py b/src/reactive/designate_handlers.py index 26dc0b7..7ca7b57 100644 --- a/src/reactive/designate_handlers.py +++ b/src/reactive/designate_handlers.py @@ -69,7 +69,6 @@ def install_packages(): with provide_charm_instance() as instance: instance.install() reactive.set_state('installed') - reactive.remove_state('amqp.requested-access') reactive.remove_state('shared-db.setup') reactive.remove_state('base-config.rendered') reactive.remove_state('db.synched') @@ -77,12 +76,10 @@ def install_packages(): @reactive.when('amqp.connected') -@reactive.when_not('amqp.requested-access') def setup_amqp_req(amqp): """Send request for rabbit access and vhost""" amqp.request_access(username='designate', vhost='openstack') - reactive.set_state('amqp.requested-access') @reactive.when('shared-db.connected') diff --git a/unit_tests/test_designate_handlers.py b/unit_tests/test_designate_handlers.py index 09eb639..83ce086 100644 --- a/unit_tests/test_designate_handlers.py +++ b/unit_tests/test_designate_handlers.py @@ -84,8 +84,7 @@ class TestHandlers(test_utils.PatchHelper): self.patch_object(handlers.reactive, 'remove_state') handlers.install_packages() the_charm.install.assert_called_once_with() - calls = [mock.call('amqp.requested-access'), - mock.call('shared-db.setup'), + calls = [mock.call('shared-db.setup'), mock.call('base-config.rendered'), mock.call('db.synched')] self.remove_state.assert_has_calls(calls) @@ -96,7 +95,6 @@ class TestHandlers(test_utils.PatchHelper): handlers.setup_amqp_req(amqp) amqp.request_access.assert_called_once_with( username='designate', vhost='openstack') - self.set_state.assert_called_once_with('amqp.requested-access') def test_database(self): database = mock.MagicMock()