Merge "Remove legacy checks"

This commit is contained in:
Zuul 2022-04-25 12:29:33 +00:00 committed by Gerrit Code Review
commit eac35c1d99
2 changed files with 1 additions and 26 deletions

View File

@ -777,14 +777,6 @@ def set_ha_mode(vhost, mode, params=None, sync_mode='automatic'):
sync has to be done
http://www.rabbitmq.com./ha.html#eager-synchronisation
"""
if caching_cmp_pkgrevno('rabbitmq-server', '3.0.0') < 0:
log(("Mirroring queues cannot be enabled, only supported "
"in rabbitmq-server >= 3.0"), level=WARNING)
log(("More information at http://www.rabbitmq.com/blog/"
"2012/11/19/breaking-things-with-rabbitmq-3-0"), level='INFO')
return
if mode == 'all':
definition = {
"ha-mode": "all",
@ -811,13 +803,6 @@ def clear_ha_mode(vhost, name='HA', force=False):
"""
Clear policy from the `vhost` by `name`
"""
if cmp_pkgrevno('rabbitmq-server', '3.0.0') < 0:
log(("Mirroring queues not supported "
"in rabbitmq-server >= 3.0"), level=WARNING)
log(("More information at http://www.rabbitmq.com/blog/"
"2012/11/19/breaking-things-with-rabbitmq-3-0"), level='INFO')
return
log("Clearing '%s' policy from vhost '%s'" % (name, vhost), level='INFO')
try:
clear_policy(vhost, name)
@ -831,13 +816,6 @@ def set_all_mirroring_queues(enable):
:param enable: if True then enable mirroring queue for all the vhosts,
otherwise the HA policy is removed
"""
if cmp_pkgrevno('rabbitmq-server', '3.0.0') < 0:
log(("Mirroring queues not supported "
"in rabbitmq-server >= 3.0"), level=WARNING)
log(("More information at http://www.rabbitmq.com/blog/"
"2012/11/19/breaking-things-with-rabbitmq-3-0"), level='INFO')
return
if enable:
status_set('active', 'Checking queue mirroring is enabled')
else:

View File

@ -1490,16 +1490,13 @@ class UtilsTests(CharmTestCase):
mock_cmp_pkgrevno.return_value = -1
self.assertFalse(rabbit_utils.rabbit_supports_json())
@mock.patch('rabbit_utils.caching_cmp_pkgrevno')
@mock.patch('rabbit_utils.set_policy')
@mock.patch('rabbit_utils.config')
def test_set_ha_mode(self,
mock_config,
mock_set_policy,
mock_caching_cmp_pkgrevno):
mock_set_policy):
"""Testing set_ha_mode"""
mock_config.side_effect = self.test_config
mock_caching_cmp_pkgrevno.return_value = 1
expected_policy = {
'all': {