|
|
cca0ee |
From 0d63dd38a152f6edc852b209ee82e00f31cc7a70 Mon Sep 17 00:00:00 2001
|
|
|
cca0ee |
From: Tomas Jelinek <tojeline@redhat.com>
|
|
|
cca0ee |
Date: Tue, 7 Feb 2017 17:50:51 +0100
|
|
|
cca0ee |
Subject: [PATCH] fix "pcs cluster cib-push scope="
|
|
|
cca0ee |
|
|
|
cca0ee |
---
|
|
|
cca0ee |
pcs/cluster.py | 10 ++++++----
|
|
|
cca0ee |
1 file changed, 6 insertions(+), 4 deletions(-)
|
|
|
cca0ee |
|
|
|
cca0ee |
diff --git a/pcs/cluster.py b/pcs/cluster.py
|
|
|
cca0ee |
index 69e2852..32ea8c3 100644
|
|
|
cca0ee |
--- a/pcs/cluster.py
|
|
|
cca0ee |
+++ b/pcs/cluster.py
|
|
|
cca0ee |
@@ -1201,23 +1201,25 @@ def cluster_push(argv):
|
|
|
cca0ee |
filename = arg
|
|
|
cca0ee |
else:
|
|
|
cca0ee |
arg_name, arg_value = arg.split("=", 1)
|
|
|
cca0ee |
- if arg_name == "scope" and "--config" not in utils.pcs_options:
|
|
|
cca0ee |
+ if arg_name == "scope":
|
|
|
cca0ee |
+ if "--config" in utils.pcs_options:
|
|
|
cca0ee |
+ utils.err("Cannot use both scope and --config")
|
|
|
cca0ee |
if not utils.is_valid_cib_scope(arg_value):
|
|
|
cca0ee |
utils.err("invalid CIB scope '%s'" % arg_value)
|
|
|
cca0ee |
else:
|
|
|
cca0ee |
scope = arg_value
|
|
|
cca0ee |
- if arg_name == "diff-against":
|
|
|
cca0ee |
+ elif arg_name == "diff-against":
|
|
|
cca0ee |
diff_against = arg_value
|
|
|
cca0ee |
else:
|
|
|
cca0ee |
usage.cluster(["cib-push"])
|
|
|
cca0ee |
sys.exit(1)
|
|
|
cca0ee |
if "--config" in utils.pcs_options:
|
|
|
cca0ee |
scope = "configuration"
|
|
|
cca0ee |
+ if diff_against and scope:
|
|
|
cca0ee |
+ utils.err("Cannot use both scope and diff-against")
|
|
|
cca0ee |
if not filename:
|
|
|
cca0ee |
usage.cluster(["cib-push"])
|
|
|
cca0ee |
sys.exit(1)
|
|
|
cca0ee |
- if diff_against and scope:
|
|
|
cca0ee |
- utils.err("Cannot use both scope and diff-against")
|
|
|
cca0ee |
|
|
|
cca0ee |
try:
|
|
|
cca0ee |
new_cib_dom = xml.dom.minidom.parse(filename)
|
|
|
cca0ee |
--
|
|
|
cca0ee |
1.8.3.1
|
|
|
cca0ee |
|