From 05c0aa800543159f1f38ed0d887d667912324a6d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 26 2018 18:18:43 +0000 Subject: import WALinuxAgent-2.2.18-2.el7 --- diff --git a/SOURCES/wa-Add-show-configuration-option.patch b/SOURCES/wa-Add-show-configuration-option.patch new file mode 100644 index 0000000..91ca77f --- /dev/null +++ b/SOURCES/wa-Add-show-configuration-option.patch @@ -0,0 +1,102 @@ +From 8575535c25a5e25f7352275326d291f404ef5feb Mon Sep 17 00:00:00 2001 +From: Eduardo Otubo +Date: Fri, 13 Apr 2018 10:14:36 +0200 +Subject: [PATCH] Add -show-configuration option + +RH-Author: Eduardo Otubo +Message-id: <20180413101436.9118-1-otubo@redhat.com> +Patchwork-id: 79602 +O-Subject: [RHEL-7 WALinuxAgent PATCH] Add -show-configuration option +Bugzilla: 1508340 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Mohammed Gamal + + commit d7fe940b27955b0bac5143474beee26ccb546842 + Author: Christopher Boumenot + Date: Mon Nov 27 17:18:32 2017 -0800 + + Add -show-configuration option + +Signed-off-by: Eduardo Otubo +Signed-off-by: Miroslav Rezanina +--- + azurelinuxagent/agent.py | 15 ++++++++------- + tests/test_agent.py | 21 +++++++++++++++++++-- + 2 files changed, 27 insertions(+), 9 deletions(-) + +diff --git a/azurelinuxagent/agent.py b/azurelinuxagent/agent.py +index e99f7be..87ab3c1 100644 +--- a/azurelinuxagent/agent.py ++++ b/azurelinuxagent/agent.py +@@ -144,7 +144,7 @@ def main(args=[]): + if command == "version": + version() + elif command == "help": +- usage() ++ print(usage()) + elif command == "start": + start(conf_file_path=conf_file_path) + else: +@@ -228,15 +228,16 @@ def version(): + + def usage(): + """ +- Show agent usage ++ Return agent usage message + """ +- print("") +- print((("usage: {0} [-verbose] [-force] [-help] " ++ s = "\n" ++ s += ("usage: {0} [-verbose] [-force] [-help] " + "-configuration-path:" + "-deprovision[+user]|-register-service|-version|-daemon|-start|" +- "-run-exthandlers]" +- "").format(sys.argv[0]))) +- print("") ++ "-run-exthandlers|-show-configuration]" ++ "").format(sys.argv[0]) ++ s += "\n" ++ return s + + def start(conf_file_path=None): + """ +diff --git a/tests/test_agent.py b/tests/test_agent.py +index 42edda2..2cb95f9 100644 +--- a/tests/test_agent.py ++++ b/tests/test_agent.py +@@ -15,9 +15,7 @@ + # Requires Python 2.4+ and Openssl 1.0+ + # + +-import mock + import os.path +-import sys + + from azurelinuxagent.agent import * + from azurelinuxagent.common.conf import * +@@ -167,3 +165,22 @@ class TestAgent(AgentTestCase): + for k in sorted(configuration.keys()): + actual_configuration.append("{0} = {1}".format(k, configuration[k])) + self.assertEqual(EXPECTED_CONFIGURATION, actual_configuration) ++ ++ def test_agent_usage_message(self): ++ message = usage() ++ ++ # Python 2.6 does not have assertIn() ++ self.assertTrue("-verbose" in message) ++ self.assertTrue("-force" in message) ++ self.assertTrue("-help" in message) ++ self.assertTrue("-configuration-path" in message) ++ self.assertTrue("-deprovision" in message) ++ self.assertTrue("-register-service" in message) ++ self.assertTrue("-version" in message) ++ self.assertTrue("-daemon" in message) ++ self.assertTrue("-start" in message) ++ self.assertTrue("-run-exthandlers" in message) ++ self.assertTrue("-show-configuration" in message) ++ ++ # sanity check ++ self.assertFalse("-not-a-valid-option" in message) +-- +1.8.3.1 + diff --git a/SPECS/WALinuxAgent.spec b/SPECS/WALinuxAgent.spec index dd5d3c6..093749d 100644 --- a/SPECS/WALinuxAgent.spec +++ b/SPECS/WALinuxAgent.spec @@ -1,7 +1,7 @@ %define name WALinuxAgent %define version 2.2.18 %define unmangled_version 2.2.18 -%define release 1 +%define release 2 %if 0%{?rhel} < 7 %global initsys sysV @@ -15,6 +15,8 @@ Version: %{version} Release: %{release}%{?dist} Source0: WALinuxAgent-2.2.18.tar.gz Patch0002: 0002-Remove-FIPS-setting-from-the-default-config.patch +# For bz#1508340 - [WALA] WALA usage prompt lack of " waagent -show-configuration" +Patch3: wa-Add-show-configuration-option.patch License: Apache License Version 2.0 Group: Development/Libraries @@ -70,6 +72,7 @@ images that are built to run in the Azure environment. %setup -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version} %patch0002 -p1 +%patch3 -p1 %build python setup.py build @@ -118,6 +121,11 @@ fi %defattr(-,root,root) %changelog +* Thu May 03 2018 Miroslav Rezanina - 2.2.18-2.el7 +- wa-Add-show-configuration-option.patch [bz#1508340] +- Resolves: bz#1508340 + ([WALA] WALA usage prompt lack of " waagent -show-configuration") + * Tue Oct 10 2017 Miroslav Rezanina - 2.2.18-1.el7 - Rebase to 2.2.18 [bz#1491873] - Resolves: bz#1491873