def test_pause_unit_helper(self): with mock.patch.object(rabbit_utils, '_pause_resume_helper') as prh: rabbit_utils.pause_unit_helper('random-config') prh.assert_called_once_with(rabbit_utils.pause_unit, 'random-config') with mock.patch.object(rabbit_utils, '_pause_resume_helper') as prh: rabbit_utils.resume_unit_helper('random-config') prh.assert_called_once_with(rabbit_utils.resume_unit, 'random-config')
def test_pause_unit_helper(self): with mock.patch.object(rabbit_utils, '_pause_resume_helper') as prh: rabbit_utils.pause_unit_helper('random-config') prh.assert_called_once_with( rabbit_utils.pause_unit, 'random-config') with mock.patch.object(rabbit_utils, '_pause_resume_helper') as prh: rabbit_utils.resume_unit_helper('random-config') prh.assert_called_once_with( rabbit_utils.resume_unit, 'random-config')
def series_upgrade_prepare(): set_unit_upgrading() if not is_unit_paused_set(): log("Pausing unit for series upgrade.") rabbit.pause_unit_helper(rabbit.ConfigRenderer(rabbit.CONFIG_FILES())) if is_leader(): if not leader_get('cluster_series_upgrading'): # Inform the entire cluster a series upgrade is occurring. # Run the complete-cluster-series-upgrade action on the leader to # clear this setting when the full cluster has completed its # upgrade. leader_set(cluster_series_upgrading=True)
def series_upgrade_prepare(): set_unit_upgrading() if not is_unit_paused_set(): log("Pausing unit for series upgrade.") rabbit.pause_unit_helper(rabbit.ConfigRenderer(rabbit.CONFIG_FILES)) if is_leader(): if not leader_get('cluster_series_upgrading'): # Inform the entire cluster a series upgrade is occurring. # Run the complete-cluster-series-upgrade action on the leader to # clear this setting when the full cluster has completed its # upgrade. leader_set(cluster_series_upgrading=True)
def pause(args): """Pause the RabbitMQ services. @raises Exception should the service fail to stop. """ pause_unit_helper(ConfigRenderer(CONFIG_FILES))