Lev Veyde has uploaded a new change for review. Change subject: packaging: setup: Add isDwhUp function to dwh_history_timekeeping module ......................................................................
packaging: setup: Add isDwhUp function to dwh_history_timekeeping module This function replaces the _remote_dwh_is_up function from the dwh upgrade plugin, with a more generic function. Change-Id: I30212df28cddb835ea65448376994a8be8601d73 Signed-off-by: Lev Veyde <[email protected]> --- M packaging/setup/ovirt_engine_setup/engine_common/dwh_history_timekeeping.py M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/upgrade/dwh.py 2 files changed, 12 insertions(+), 9 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/73/38373/1 diff --git a/packaging/setup/ovirt_engine_setup/engine_common/dwh_history_timekeeping.py b/packaging/setup/ovirt_engine_setup/engine_common/dwh_history_timekeeping.py index c247645..24b5981 100644 --- a/packaging/setup/ovirt_engine_setup/engine_common/dwh_history_timekeeping.py +++ b/packaging/setup/ovirt_engine_setup/engine_common/dwh_history_timekeeping.py @@ -71,4 +71,11 @@ ) +def isDwhUp(statement): + return getValueFromTimekeeping( + statement, + name=DB_KEY_RUNNING + ) == '1' + + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/upgrade/dwh.py b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/upgrade/dwh.py index 8594494..5d6f33c 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/upgrade/dwh.py +++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/upgrade/dwh.py @@ -46,12 +46,6 @@ def __init__(self, context): super(Plugin, self).__init__(context=context) - def _remote_dwh_is_up(self): - return dwh_history_timekeeping.getValueFromTimekeeping( - statement=self._statement, - name=dwh_history_timekeeping.DB_KEY_RUNNING - ) == '1' - def _update_DisconnectDwh(self, value): vdcoption.VdcOption( statement=self._statement, @@ -98,7 +92,7 @@ statement=self._statement, name=dwh_history_timekeeping.DB_KEY_HOSTNAME ) - if self._remote_dwh_is_up(): + if dwh_history_timekeeping.isDwhUp(self._statement): self.logger.info( _( 'Stopping DWH service on host {hostname}...' @@ -109,7 +103,9 @@ try: self._update_DisconnectDwh('1') retries = self.RETRIES - while self._remote_dwh_is_up() and retries > 0: + while dwh_history_timekeeping.isDwhUp( + self._statement + ) and retries > 0: retries -= 1 self.logger.debug( 'Waiting for remote dwh to die, %s retries left' % @@ -118,7 +114,7 @@ time.sleep(self.DELAY) finally: self._update_DisconnectDwh('0') - if self._remote_dwh_is_up(): + if dwh_history_timekeeping.isDwhUp(self._statement): self.logger.error( _( 'dwhd is currently running.\n' -- To view, visit https://gerrit.ovirt.org/38373 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30212df28cddb835ea65448376994a8be8601d73 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Lev Veyde <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
