From 7821044f1adf89d74c4c9059da530a06c7595295dfceb2189b5d1b1fae30e9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 19 May 2020 06:11:19 +0000 Subject: [PATCH] Accepting request 807070 from home:XinLiang:branches:network:ha-clustering:Factory - Add ssh_key option used by -i option of ssh and scp(bsc#1169581) Add patch 0001-Add-ssh_key-option-used-by-i-option-of-ssh-scp.patch OBS-URL: https://build.opensuse.org/request/show/807070 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parallax?expand=0&rev=35 --- ...y-option-used-by-i-option-of-ssh-scp.patch | 80 +++++++++++++++++++ python-parallax.changes | 6 ++ python-parallax.spec | 3 + 3 files changed, 89 insertions(+) create mode 100644 0001-Add-ssh_key-option-used-by-i-option-of-ssh-scp.patch diff --git a/0001-Add-ssh_key-option-used-by-i-option-of-ssh-scp.patch b/0001-Add-ssh_key-option-used-by-i-option-of-ssh-scp.patch new file mode 100644 index 0000000..5e4c7f4 --- /dev/null +++ b/0001-Add-ssh_key-option-used-by-i-option-of-ssh-scp.patch @@ -0,0 +1,80 @@ +From f5ccee901d346873adbe5d979b5b70d0ba029570 Mon Sep 17 00:00:00 2001 +From: liangxin1300 +Date: Fri, 24 Apr 2020 07:05:13 +0800 +Subject: [PATCH] Add ssh_key option used by -i option of ssh/scp + +--- + parallax/__init__.py | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +diff --git a/parallax/__init__.py b/parallax/__init__.py +index fc1a6e7..1008ca2 100644 +--- a/parallax/__init__.py ++++ b/parallax/__init__.py +@@ -87,6 +87,7 @@ class Options(object): + askpass = False # Ask for a password + outdir = None # Write stdout to a file per host in this directory + errdir = None # Write stderr to a file per host in this directory ++ ssh_key = None # Specific ssh key used by ssh/scp -i option + ssh_options = [] # Extra options to pass to SSH + ssh_extra = [] # Extra arguments to pass to SSH + verbose = False # Warning and diagnostic messages +@@ -138,19 +139,21 @@ class _CallOutputBuilder(object): + return ret + + +-def _build_call_cmd(host, port, user, cmdline, options, extra): ++def _build_call_cmd(host, port, user, cmdline, opts): + cmd = ['ssh', host, + '-o', 'NumberOfPasswordPrompts=1', + '-o', 'SendEnv=PARALLAX_NODENUM PARALLAX_HOST'] +- if options: +- for opt in options: ++ if opts.ssh_options: ++ for opt in opts.ssh_options: + cmd += ['-o', opt] + if user: + cmd += ['-l', user] + if port: + cmd += ['-p', port] +- if extra: +- cmd.extend(extra) ++ if opts.ssh_key: ++ cmd += ['-i', opts.ssh_key] ++ if opts.ssh_extra: ++ cmd.extend(opts.ssh_extra) + if cmdline: + cmd.append(cmdline) + return cmd +@@ -173,9 +176,7 @@ def call(hosts, cmdline, opts=Options()): + warn_message=opts.warn_message, + callbacks=_CallOutputBuilder()) + for host, port, user in _expand_host_port_user(hosts): +- cmd = _build_call_cmd(host, port, user, cmdline, +- options=opts.ssh_options, +- extra=opts.ssh_extra) ++ cmd = _build_call_cmd(host, port, user, cmdline, opts) + t = Task(host, port, user, cmd, + stdin=opts.input_stream, + verbose=opts.verbose, +@@ -219,6 +220,8 @@ def _build_copy_cmd(host, port, user, src, dst, opts): + cmd += ['-P', port] + if opts.recursive: + cmd.append('-r') ++ if opts.ssh_key: ++ cmd += ['-i', opts.ssh_key] + if opts.ssh_extra: + cmd.extend(opts.ssh_extra) + cmd.append(src) +@@ -312,6 +315,8 @@ def _build_slurp_cmd(host, port, user, src, dst, opts): + cmd += ['-P', port] + if opts.recursive: + cmd.append('-r') ++ if opts.ssh_key: ++ cmd += ['-i', opts.ssh_key] + if opts.ssh_extra: + cmd.extend(opts.ssh_extra) + if user: +-- +2.21.1 + diff --git a/python-parallax.changes b/python-parallax.changes index 9d54ba0..cf770ea 100644 --- a/python-parallax.changes +++ b/python-parallax.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 19 02:32:03 UTC 2020 - XinLiang + +- Add ssh_key option used by -i option of ssh and scp(bsc#1169581) + Add patch 0001-Add-ssh_key-option-used-by-i-option-of-ssh-scp.patch + ------------------------------------------------------------------- Wed Apr 1 08:54:34 UTC 2020 - Kristoffer Gronlund diff --git a/python-parallax.spec b/python-parallax.spec index f0fe1cd..0aab225 100644 --- a/python-parallax.spec +++ b/python-parallax.spec @@ -25,6 +25,8 @@ License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/krig/parallax/ Source: https://files.pythonhosted.org/packages/source/p/parallax/parallax-%{version}.tar.gz +Patch1: 0001-Add-ssh_key-option-used-by-i-option-of-ssh-scp.patch + BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -48,6 +50,7 @@ multiple nodes using SCP. %prep %setup -q -n parallax-%{version} +%patch1 -p1 %build %python_build