Fix rollback in junos_config (#31424)

* Fix rollback in junos_config

Fixes #30778

*  Call `load_configuration` with rollback id in case
   the id is given as input
*  Pass rollback id to `get_diff()` to fetch diff from device

* Fix unit test
This commit is contained in:
Ganesh Nalawade 2017-10-11 10:25:56 +05:30 committed by GitHub
parent 2ed46e04f4
commit 88da95bb77
4 changed files with 55 additions and 8 deletions

View file

@ -174,9 +174,9 @@ def locked_config(module):
unlock_configuration(module)
def get_diff(module):
def get_diff(module, rollback='0'):
reply = get_configuration(module, compare=True, format='text')
reply = get_configuration(module, compare=True, format='text', rollback=rollback)
# if warning is received from device diff is empty.
if isinstance(reply, list):
return None