예제 #1
0
 def test_clear_waiting_unit_series_upgrade(self, HookData):
     hook_data = self.MockHookData()
     HookData.return_value = hook_data
     utils.set_waiting_unit_series_upgrade()
     self.assertTrue(hook_data.kv.get('waiting-unit-series-upgrade'))
     utils.clear_waiting_unit_series_upgrade()
     self.assertFalse(hook_data.kv.get('waiting-unit-series-upgrade'))
예제 #2
0
def series_upgrade_complete():
    log("Running complete series upgrade hook", "INFO")
    clear_unit_paused()
    clear_unit_upgrading()
    config_changed()
    enable_ha_services()
    log("Resuming unit")
    resume_unit()
    clear_series_upgrade_notification()
    log("Setting waiting-unit-upgrade to False", INFO)
    clear_waiting_unit_series_upgrade()
예제 #3
0
    def test_is_waiting_unit_series_upgrade_set(self, hookdata):
        hook_data = self.MockHookData()
        hookdata.return_value = hook_data
        # false if key is absent
        self.assertFalse(utils.is_waiting_unit_series_upgrade_set())

        # True if waiting-unit-upgrade het been set
        utils.set_waiting_unit_series_upgrade()
        self.assertTrue(utils.is_waiting_unit_series_upgrade_set())

        # False if waiting-unit-upgrade has been cleared
        utils.clear_waiting_unit_series_upgrade()
        self.assertFalse(utils.is_waiting_unit_series_upgrade_set())