Merge "Drop use of 'amqp.requested-access' flag"

This commit is contained in:
Zuul 2018-12-06 04:27:14 +00:00 committed by Gerrit Code Review
commit 8a30a9da0c
2 changed files with 1 additions and 6 deletions

View File

@ -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')

View File

@ -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()