From 6c9744328ed031a71a27a776f552a03f840b884d Mon Sep 17 00:00:00 2001 From: "Denis V. Meltsaykin" Date: Mon, 22 Jun 2015 18:08:14 +0300 Subject: [PATCH] Small improvements Changed the output of `check` in case if updates were never applied. Now it's not "FAILURE!". Added `version` option, which shows current version id. Change-Id: I7bb47e7a72c4a0e4486e5d0848ea1effc915bfac Closes-Bug: 1461142 Closes-Bug: 1461141 --- scripts/mos_apply_mu.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/mos_apply_mu.py b/scripts/mos_apply_mu.py index 4811b54..9472d98 100644 --- a/scripts/mos_apply_mu.py +++ b/scripts/mos_apply_mu.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright 2013 - 2015 Mirantis, Inc. +# Copyright 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -109,7 +109,7 @@ Examples: States may be the following (separate for each node): STARTED - script has been started and it's still working PACKAGES_INSTALLING - script is installing custom packages - REPO_UPD=OK;PKGS=0 of 2 INSTALLED - execution is over, + REPO_UPD=OK;CUSTOM=0 of 2 INSTALLED - execution is over, maintenance update has been successfuly installed but installation of custom packages was unsuccessful @@ -143,6 +143,9 @@ Mirantis, 2015 install_custom = True if '--master-ip' in cmd: master_ip = cmd.split('=')[1] + if '--version' in cmd: + print ("VER_ID: 22062015") + sys.exit(19) if (env_id > 0) and (all_envs): print (usage) @@ -221,7 +224,7 @@ def check_status(ip): print("Node {0} state: {1}".format(ip, state)) return True else: - print("Node {0} FAILURE!".format(ip)) + print("Node {0}: no updates information found.".format(ip)) return False @@ -249,7 +252,7 @@ def do_node_update(nodes, env_list): print ("Unable to get packages list from file {0}".format(path)) for ip, os_version in to_update: - print ("Full log for {0} is located at /var/log/remote/" + print ("{0}'s log: /var/log/remote/" "{0}/mos_apply_mu.log".format(ip)) send_shell_script(ip, os_version) if check: -- 2.45.2