mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 08:13:08 +00:00
Fix netconf get_config lock/unlock (#40378)
Lock/unlock the datastore that is given as input for instead of default to `running`
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user