mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +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:
|
try:
|
||||||
locked = False
|
locked = False
|
||||||
if lock:
|
if lock:
|
||||||
conn.lock(target='running')
|
conn.lock(target=source)
|
||||||
locked = True
|
locked = True
|
||||||
response = conn.get_config(source=source, filter=filter)
|
response = conn.get_config(source=source, filter=filter)
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ def get_config(module, source, filter, lock=False):
|
|||||||
|
|
||||||
finally:
|
finally:
|
||||||
if locked:
|
if locked:
|
||||||
conn.unlock(target='running')
|
conn.unlock(target=source)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user