Skip to content

Commit 007d524

Browse files
committed
Dev: utils: Add info when property is newly added
1 parent 42ad4f1 commit 007d524

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

crmsh/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,11 +2795,12 @@ def set_property(property_name, property_value, property_type="crm_config", cond
27952795
origin_value = get_property(property_name, property_type)
27962796
if origin_value and str(origin_value) == str(property_value):
27972797
return
2798-
if conditional:
2799-
if crm_msec(origin_value) >= crm_msec(property_value):
2800-
return
2798+
if conditional and crm_msec(origin_value) >= crm_msec(property_value):
2799+
return
2800+
if not origin_value and property_value:
2801+
logger.info("Set property \"%s\" in %s to %s", property_name, property_type, property_value)
28012802
if origin_value and str(origin_value) != str(property_value):
2802-
logger.warning("\"{}\" in {} is set to {}, it was {}".format(property_name, property_type, property_value, origin_value))
2803+
logger.warning("\"%s\" in %s is set to %s, it was %s", property_name, property_type, property_value, origin_value)
28032804
property_sub_cmd = "property" if property_type == "crm_config" else property_type
28042805
cmd = "crm configure {} {}={}".format(property_sub_cmd, property_name, property_value)
28052806
sh.cluster_shell().get_stdout_or_raise_error(cmd)

0 commit comments

Comments
 (0)