diff --git a/plugins/modules/network/cumulus/nclu.py b/plugins/modules/network/cumulus/nclu.py index 27fcc17f..4f8a7bb1 100644 --- a/plugins/modules/network/cumulus/nclu.py +++ b/plugins/modules/network/cumulus/nclu.py @@ -150,6 +150,7 @@ sample: "interface bond0 config updated" ''' +import re from ansible.module_utils.basic import AnsibleModule @@ -165,10 +166,10 @@ def check_pending(module): """Check the pending diff of the nclu buffer.""" pending = command_helper(module, "pending", "Error in pending config. You may want to view `net pending` on this target.") - delimeter1 = "net add/del commands since the last \"net commit\"" + delimeter1 = re.compile('''net add/del commands since the last ['"]net commit['"]''') color1 = '\x1b[94m' - if delimeter1 in pending: - pending = pending.split(delimeter1)[0] + if re.search(delimeter1, pending): + pending = re.split(delimeter1, pending)[0] pending = pending.replace(color1, '') return pending.strip()