File 0010-medium-bootstrap-Handle-failure-to-fetch-config-grac.patch of Package crmsh
From 0e3644538d7c3a9ccc77e68ffe3281ac06ba4c24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Wed, 3 May 2017 16:17:32 +0200
Subject: [PATCH 10/12] medium: bootstrap: Handle failure to fetch config
gracefully (bsc#1037423)
---
crmsh/bootstrap.py | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py
index 8f914aea..16772244 100644
--- a/crmsh/bootstrap.py
+++ b/crmsh/bootstrap.py
@@ -1694,12 +1694,15 @@ def geo_fetch_config(node):
status("Retrieving configuration - This may prompt for root@%s:" % (node))
tmpdir = tmpfiles.create_dir()
invoke("scp root@%s:'/etc/booth/*' %s/" % (node, tmpdir))
- if os.path.isfile("%s/authkey" % (tmpdir)):
- invoke("mv %s/authkey %s" % (tmpdir, BOOTH_AUTH))
- if os.path.isfile("%s/booth.conf" % (tmpdir)):
- invoke("mv %s/booth.conf %s" % (tmpdir, BOOTH_CFG))
- os.chmod(BOOTH_AUTH, 0o600)
- os.chmod(BOOTH_CFG, 0o644)
+ try:
+ if os.path.isfile("%s/authkey" % (tmpdir)):
+ invoke("mv %s/authkey %s" % (tmpdir, BOOTH_AUTH))
+ os.chmod(BOOTH_AUTH, 0o600)
+ if os.path.isfile("%s/booth.conf" % (tmpdir)):
+ invoke("mv %s/booth.conf %s" % (tmpdir, BOOTH_CFG))
+ os.chmod(BOOTH_CFG, 0o644)
+ except OSError as err:
+ raise ValueError("Problem encountered with booth configuration from {}: {}".format(node, err))
def geo_cib_config(clusters):
--
2.12.2