]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: allow multiple get_parm() calls 33437/head
authorSage Weil <sage@redhat.com>
Thu, 20 Feb 2020 16:03:24 +0000 (10:03 -0600)
committerSage Weil <sage@redhat.com>
Thu, 20 Feb 2020 16:03:24 +0000 (10:03 -0600)
This fixes deployment of monitoring components when the config-json is
passed via stdin.

Signed-off-by: Sage Weil <sage@redhat.com>
src/cephadm/cephadm

index 2dccdba1b68ac19aa9a3f7d0c4e0c9179aa872d6..e9dbda44a995e8bf7c94ce9165c468fcc555406c 100755 (executable)
@@ -79,6 +79,7 @@ else:
     from urllib2 import urlopen, HTTPError
 
 container_path = ''
+cached_stdin = None
 
 class Error(Exception):
     pass
@@ -977,11 +978,16 @@ def get_parm(option):
     if not option:
         return dict()
 
+    global cached_stdin
     if option == '-':
-        try:
-            j = injected_stdin  # type: ignore
-        except NameError:
-            j = sys.stdin.read()
+        if cached_stdin is not None:
+            j = cached_stdin
+        else:
+            try:
+                j = injected_stdin  # type: ignore
+            except NameError:
+                j = sys.stdin.read()
+                cached_stdin = j
     else:
         # inline json string
         if option[0] == '{' and option[-1] == '}':