|
|
be1b1f |
From 8811ee0493b956207f3336e9e0eb1395a530af8f Mon Sep 17 00:00:00 2001
|
|
|
be1b1f |
From: Ivan Devat <idevat@redhat.com>
|
|
|
be1b1f |
Date: Mon, 6 Aug 2018 08:43:47 +0200
|
|
|
be1b1f |
Subject: [PATCH] fix error for an inaccessible resource in a bundle
|
|
|
be1b1f |
|
|
|
be1b1f |
---
|
|
|
be1b1f |
pcs/cli/common/console_report.py | 6 +++---
|
|
|
be1b1f |
pcs/cli/common/test/test_console_report.py | 6 +++---
|
|
|
be1b1f |
pcs/resource.py | 1 +
|
|
|
be1b1f |
3 files changed, 7 insertions(+), 6 deletions(-)
|
|
|
be1b1f |
|
|
|
be1b1f |
diff --git a/pcs/cli/common/console_report.py b/pcs/cli/common/console_report.py
|
|
|
be1b1f |
index f2cee05e..06ea8f72 100644
|
|
|
be1b1f |
--- a/pcs/cli/common/console_report.py
|
|
|
be1b1f |
+++ b/pcs/cli/common/console_report.py
|
|
|
be1b1f |
@@ -1434,8 +1434,8 @@ CODE_TO_MESSAGE_BUILDER_MAP = {
|
|
|
be1b1f |
,
|
|
|
be1b1f |
codes.RESOURCE_IN_BUNDLE_NOT_ACCESSIBLE: lambda info:
|
|
|
be1b1f |
(
|
|
|
be1b1f |
- "Resource '{resource_id}' will not be accessible by the cluster "
|
|
|
be1b1f |
- "inside bundle '{bundle_id}'. At least one of bundle options "
|
|
|
be1b1f |
- "'control-port' or 'ip-range-start' has to be specified."
|
|
|
be1b1f |
+ "Resource '{inner_resource_id}' will not be accessible by the "
|
|
|
be1b1f |
+ "cluster inside bundle '{bundle_id}', at least one of bundle "
|
|
|
be1b1f |
+ "options 'control-port' or 'ip-range-start' has to be specified"
|
|
|
be1b1f |
).format(**info)
|
|
|
be1b1f |
}
|
|
|
be1b1f |
diff --git a/pcs/cli/common/test/test_console_report.py b/pcs/cli/common/test/test_console_report.py
|
|
|
be1b1f |
index dee633ad..5fe49466 100644
|
|
|
be1b1f |
--- a/pcs/cli/common/test/test_console_report.py
|
|
|
be1b1f |
+++ b/pcs/cli/common/test/test_console_report.py
|
|
|
be1b1f |
@@ -2126,12 +2126,12 @@ class ResourceInBundleNotAccessible(NameBuildTest):
|
|
|
be1b1f |
self.assert_message_from_info(
|
|
|
be1b1f |
(
|
|
|
be1b1f |
"Resource 'resourceA' will not be accessible by the cluster "
|
|
|
be1b1f |
- "inside bundle 'bundleA'. At least one of bundle options "
|
|
|
be1b1f |
- "'control-port' or 'ip-range-start' has to be specified."
|
|
|
be1b1f |
+ "inside bundle 'bundleA', at least one of bundle options "
|
|
|
be1b1f |
+ "'control-port' or 'ip-range-start' has to be specified"
|
|
|
be1b1f |
),
|
|
|
be1b1f |
dict(
|
|
|
be1b1f |
bundle_id="bundleA",
|
|
|
be1b1f |
- resource_id="resourceA",
|
|
|
be1b1f |
+ inner_resource_id="resourceA",
|
|
|
be1b1f |
)
|
|
|
be1b1f |
)
|
|
|
be1b1f |
|
|
|
be1b1f |
diff --git a/pcs/resource.py b/pcs/resource.py
|
|
|
be1b1f |
index 001bad50..c605cc6a 100644
|
|
|
be1b1f |
--- a/pcs/resource.py
|
|
|
be1b1f |
+++ b/pcs/resource.py
|
|
|
be1b1f |
@@ -439,6 +439,7 @@ def resource_create(lib, argv, modifiers):
|
|
|
be1b1f |
**settings
|
|
|
be1b1f |
)
|
|
|
be1b1f |
elif "bundle" in parts:
|
|
|
be1b1f |
+ settings["allow_not_accessible_resource"] = modifiers["force"]
|
|
|
be1b1f |
lib.resource.create_into_bundle(
|
|
|
be1b1f |
ra_id, ra_type, parts["op"],
|
|
|
be1b1f |
parts["meta"],
|
|
|
be1b1f |
--
|
|
|
be1b1f |
2.13.6
|
|
|
be1b1f |
|