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:
Ganesh Nalawade 2018-05-18 13:10:28 +05:30 committed by GitHub
parent a996d4836a
commit de2c1dc241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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