From de27e8d228917faba3671e7628c624d44afc590f Mon Sep 17 00:00:00 2001 From: "Keisuke.K" Date: Thu, 17 Aug 2017 03:57:57 +0900 Subject: [PATCH] nmcli should not return error if trying to delete an absent connection (#20677) --- lib/ansible/modules/net_tools/nmcli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/net_tools/nmcli.py b/lib/ansible/modules/net_tools/nmcli.py index 51573e9415..4126c05a9f 100644 --- a/lib/ansible/modules/net_tools/nmcli.py +++ b/lib/ansible/modules/net_tools/nmcli.py @@ -1155,8 +1155,8 @@ def main(): module.exit_json(changed=True) (rc, out, err)=nmcli.down_connection() (rc, out, err)=nmcli.remove_connection() - if rc!=0: - module.fail_json(name =('No Connection named %s exists' % nmcli.conn_name), msg=err, rc=rc) + if rc!=0: + module.fail_json(name =('No Connection named %s exists' % nmcli.conn_name), msg=err, rc=rc) elif nmcli.state=='present': if nmcli.connection_exists():