File 0003-high-scripts-fix-broken-cluster-init-script-bsc-9631.patch of Package crmsh.1619
From 115f79e1cca2c6f52cf388e37935947ace064b17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Fri, 22 Jan 2016 08:10:31 +0100
Subject: [PATCH 3/3] high: scripts: fix broken cluster init script
(bsc#963135)
---
modules/scripts.py | 3 ++-
scripts/init/configure.py | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/scripts.py b/modules/scripts.py
index c3bb4ca..12fc61f 100644
--- a/modules/scripts.py
+++ b/modules/scripts.py
@@ -2008,7 +2008,8 @@ class RunActions(object):
return None
self.printer.debug("Result(local): %s" % repr(out))
if is_json_output:
- out = json.loads(out)
+ if out != '':
+ out = json.loads(out)
return out
def local_node_name(self):
diff --git a/scripts/init/configure.py b/scripts/init/configure.py
index 1b87ecf..26ca6a1 100755
--- a/scripts/init/configure.py
+++ b/scripts/init/configure.py
@@ -11,7 +11,7 @@ def _authorize_key(keypath):
if os.path.exists('/root/.ssh/authorized_keys'):
pubkey = open(pubkeypath).read()
if pubkey not in open('/root/.ssh/authorized_keys').read():
- crm_script.sudo_call("cat %s >> /root/.ssh/authorized_keys" % (pubkeypath))
+ crm_script.sudo_call("cat %s >> /root/.ssh/authorized_keys" % (pubkeypath), shell=True)
else:
crm_script.sudo_call(["cp", pubkeypath, '/root/.ssh/authorized_keys'])
--
2.7.0