Blob Blame History Raw
From 0d63dd38a152f6edc852b209ee82e00f31cc7a70 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Tue, 7 Feb 2017 17:50:51 +0100
Subject: [PATCH] fix "pcs cluster cib-push scope="

---
 pcs/cluster.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pcs/cluster.py b/pcs/cluster.py
index 69e2852..32ea8c3 100644
--- a/pcs/cluster.py
+++ b/pcs/cluster.py
@@ -1201,23 +1201,25 @@ def cluster_push(argv):
             filename = arg
         else:
             arg_name, arg_value = arg.split("=", 1)
-            if arg_name == "scope" and "--config" not in utils.pcs_options:
+            if arg_name == "scope":
+                if "--config" in utils.pcs_options:
+                    utils.err("Cannot use both scope and --config")
                 if not utils.is_valid_cib_scope(arg_value):
                     utils.err("invalid CIB scope '%s'" % arg_value)
                 else:
                     scope = arg_value
-            if arg_name == "diff-against":
+            elif arg_name == "diff-against":
                 diff_against = arg_value
             else:
                 usage.cluster(["cib-push"])
                 sys.exit(1)
     if "--config" in utils.pcs_options:
         scope = "configuration"
+    if diff_against and scope:
+        utils.err("Cannot use both scope and diff-against")
     if not filename:
         usage.cluster(["cib-push"])
         sys.exit(1)
-    if diff_against and scope:
-        utils.err("Cannot use both scope and diff-against")
 
     try:
         new_cib_dom = xml.dom.minidom.parse(filename)
-- 
1.8.3.1