Joey Boggs has uploaded a new change for review. Change subject: ovirt-node-upgrade prevent multiple runs after a sucessful upgrade ......................................................................
ovirt-node-upgrade prevent multiple runs after a sucessful upgrade rhbz#1006390 Change-Id: I838ae4116ca587e84a0d6c7f6ad323204cffcade Signed-off-by: Joey Boggs <[email protected]> --- M scripts/ovirt-node-upgrade.py 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/03/19303/1 diff --git a/scripts/ovirt-node-upgrade.py b/scripts/ovirt-node-upgrade.py index c28aebb..dfde8fe 100755 --- a/scripts/ovirt-node-upgrade.py +++ b/scripts/ovirt-node-upgrade.py @@ -32,7 +32,7 @@ LOG_PREFIX = "ovirt-node-upgrade" OVIRT_UPGRADE_LOCK = "/tmp/.ovirt_upgrade.lock" - +OVIRT_UPGRADED = "/tmp/ovirt_upgraded" def which(file): ret = None @@ -250,6 +250,7 @@ shutil.rmtree(self._tmp_dir) if self.iso_tmp and os.path.exists(self.iso_tmp): os.remove(self.iso_tmp) + open(OVIRT_UPGRADED, 'w').close() except: self._logger.warning("Cleanup Failed") self._logger.debug('exception', exc_info=True) @@ -315,6 +316,8 @@ self._logger.debug(self._options) if os.geteuid() != 0: raise RuntimeError("You must run as root") + if os.path.exists(OVIRT_UPGRADED): + raise RuntimeError("Previous upgrade completed, you must reboot") with LockFile(): if not self._options.iso_file: -- To view, visit http://gerrit.ovirt.org/19303 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I838ae4116ca587e84a0d6c7f6ad323204cffcade Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: master Gerrit-Owner: Joey Boggs <[email protected]> _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
