Hello community, here is the log from the commit of package fence-agents for openSUSE:Factory checked in at 2018-05-18 14:27:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fence-agents (Old) and /work/SRC/openSUSE:Factory/.fence-agents.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fence-agents" Fri May 18 14:27:42 2018 rev:39 rq:610127 version:4.0.25+git.1524215631.8f9c770a Changes: -------- --- /work/SRC/openSUSE:Factory/fence-agents/fence-agents.changes 2018-04-26 13:38:57.378046087 +0200 +++ /work/SRC/openSUSE:Factory/.fence-agents.new/fence-agents.changes 2018-05-18 14:27:55.190333510 +0200 @@ -1,0 +2,12 @@ +Thu May 17 16:19:11 UTC 2018 - [email protected] + +- run_command: fix Python 3 encoding issue (bsc#1082871) +- fence_gce: use default credentials from googleapiclient +- fence_gce: fix regression - missing import oauth2client.client +- fence_gce: fix regression - missing import googleapiclient.discovery +- Add 0002-fence_gce-fix-regression-missing-import-googleapicli.patch +- Add 0003-fence_gce-fix-regression-missing-import-oauth2client.patch +- Add 0004-fence_gce-use-default-credentials-from-googleapiclie.patch +- Add 0005-run_command-fix-Python-3-encoding-issue.patch + +------------------------------------------------------------------- New: ---- 0002-fence_gce-fix-regression-missing-import-googleapicli.patch 0003-fence_gce-fix-regression-missing-import-oauth2client.patch 0004-fence_gce-use-default-credentials-from-googleapiclie.patch 0005-run_command-fix-Python-3-encoding-issue.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fence-agents.spec ++++++ --- /var/tmp/diff_new_pack.IcolJ9/_old 2018-05-18 14:27:55.778311932 +0200 +++ /var/tmp/diff_new_pack.IcolJ9/_new 2018-05-18 14:27:55.782311785 +0200 @@ -32,6 +32,14 @@ Url: https://github.com/ClusterLabs/fence-agents Source0: %{name}-%{version}.tar.xz Patch1: 0001-Use-Python-3-for-all-scripts-bsc-1065966.patch +# fence_gce: fix regression - missing import googleapiclient.discovery +Patch2: 0002-fence_gce-fix-regression-missing-import-googleapicli.patch +# fence_gce: fix regression - missing import oauth2client.client +Patch3: 0003-fence_gce-fix-regression-missing-import-oauth2client.patch +# fence_gce: use default credentials from googleapiclient +Patch4: 0004-fence_gce-use-default-credentials-from-googleapiclie.patch +# run_command: fix Python 3 encoding issue (bsc#1082871) +Patch5: 0005-run_command-fix-Python-3-encoding-issue.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf @@ -103,6 +111,10 @@ %prep %setup -q -n %{name}-%{version} %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}" ++++++ 0002-fence_gce-fix-regression-missing-import-googleapicli.patch ++++++ >From e22d41504ee53e5a4a72009581d4d69e9ae7447b Mon Sep 17 00:00:00 2001 From: Helen Koike <[email protected]> Date: Fri, 20 Apr 2018 01:59:38 -0300 Subject: [PATCH 2/5] fence_gce: fix regression - missing import googleapiclient.discovery import googleapiclient.discovery was missing import googleapiclient is not required --- fence/agents/gce/fence_gce.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fence/agents/gce/fence_gce.py b/fence/agents/gce/fence_gce.py index c1f8b16f..04d59846 100644 --- a/fence/agents/gce/fence_gce.py +++ b/fence/agents/gce/fence_gce.py @@ -4,7 +4,7 @@ import atexit import sys sys.path.append("@FENCEAGENTSLIBDIR@") -import googleapiclient +import googleapiclient.discovery import oauth2client from fencing import fail_usage, run_delay, all_opt, atexit_handler, check_input, process_input, show_docs, fence_action -- 2.16.3 ++++++ 0003-fence_gce-fix-regression-missing-import-oauth2client.patch ++++++ >From ba8169f4ef2d715ed681ae38f599aa544fa00023 Mon Sep 17 00:00:00 2001 From: Helen Koike <[email protected]> Date: Tue, 1 May 2018 14:01:20 -0300 Subject: [PATCH 3/5] fence_gce: fix regression - missing import oauth2client.client import oauth2client.client was missing import oauth2client is not necessary Fix wrong path to GoogleCredentials --- fence/agents/gce/fence_gce.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fence/agents/gce/fence_gce.py b/fence/agents/gce/fence_gce.py index 04d59846..3a614f14 100644 --- a/fence/agents/gce/fence_gce.py +++ b/fence/agents/gce/fence_gce.py @@ -5,7 +5,7 @@ import sys sys.path.append("@FENCEAGENTSLIBDIR@") import googleapiclient.discovery -import oauth2client +import oauth2client.client from fencing import fail_usage, run_delay, all_opt, atexit_handler, check_input, process_input, show_docs, fence_action def translate_status(instance_status): @@ -99,7 +99,7 @@ def main(): run_delay(options) try: - credentials = oauth2client.GoogleCredentials.get_application_default() + credentials = oauth2client.client.GoogleCredentials.get_application_default() conn = googleapiclient.discovery.build('compute', 'v1', credentials=credentials) except Exception as err: fail_usage("Failed: Create GCE compute v1 connection: {}".format(str(err))) -- 2.16.3 ++++++ 0004-fence_gce-use-default-credentials-from-googleapiclie.patch ++++++ >From f94bc0bb6058fe791d597ed8aa5f60f9410debdb Mon Sep 17 00:00:00 2001 From: Helen Koike <[email protected]> Date: Fri, 27 Apr 2018 13:51:40 -0300 Subject: [PATCH 4/5] fence_gce: use default credentials from googleapiclient There are two ways for performing credentials 1) google-auth 2) oauth2client (deprecated) googleapiclient check which libraries are present in the system and use the most apropriated one in the order above. Also keep compatibility with previous version of googleapiclient library --- fence/agents/gce/fence_gce.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fence/agents/gce/fence_gce.py b/fence/agents/gce/fence_gce.py index 3a614f14..3abb5207 100644 --- a/fence/agents/gce/fence_gce.py +++ b/fence/agents/gce/fence_gce.py @@ -5,7 +5,6 @@ import sys sys.path.append("@FENCEAGENTSLIBDIR@") import googleapiclient.discovery -import oauth2client.client from fencing import fail_usage, run_delay, all_opt, atexit_handler, check_input, process_input, show_docs, fence_action def translate_status(instance_status): @@ -99,7 +98,10 @@ def main(): run_delay(options) try: - credentials = oauth2client.client.GoogleCredentials.get_application_default() + credentials = None + if tuple(googleapiclient.__version__) < tuple("1.6.0"): + import oauth2client.client + credentials = oauth2client.client.GoogleCredentials.get_application_default() conn = googleapiclient.discovery.build('compute', 'v1', credentials=credentials) except Exception as err: fail_usage("Failed: Create GCE compute v1 connection: {}".format(str(err))) -- 2.16.3 ++++++ 0005-run_command-fix-Python-3-encoding-issue.patch ++++++ >From b587642048b9f75cdc08d4d9e3fa03f14811cc21 Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen <[email protected]> Date: Fri, 20 Apr 2018 15:16:42 +0200 Subject: [PATCH 5/5] run_command: fix Python 3 encoding issue --- fence/agents/lib/fencing.py.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 5b38460e..15914f0f 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -995,7 +995,9 @@ def run_command(options, command, timeout=None, env=None, log_command=None): logging.info("Executing: %s\n", log_command or command) try: - process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) + process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, + # decodes newlines and in python3 also converts bytes to str + universal_newlines=(sys.version_info[0] > 2)) except OSError: fail_usage("Unable to run %s\n" % command) -- 2.16.3
