From de2c1dc241cc90f5e9c4dffd35c508629b42e4b7 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Fri, 18 May 2018 13:10:28 +0530 Subject: [PATCH] Fix netconf get_config lock/unlock (#40378) Lock/unlock the datastore that is given as input for instead of default to `running` --- lib/ansible/module_utils/network/netconf/netconf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/network/netconf/netconf.py b/lib/ansible/module_utils/network/netconf/netconf.py index 73479c3136..d946ec45b3 100644 --- a/lib/ansible/module_utils/network/netconf/netconf.py +++ b/lib/ansible/module_utils/network/netconf/netconf.py @@ -72,7 +72,7 @@ def get_config(module, source, filter, lock=False): try: locked = False if lock: - conn.lock(target='running') + conn.lock(target=source) locked = True response = conn.get_config(source=source, filter=filter) @@ -81,7 +81,7 @@ def get_config(module, source, filter, lock=False): finally: if locked: - conn.unlock(target='running') + conn.unlock(target=source) return response