mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fix rollback option in cli_config module (#44834)
* Fix rollback option in cli_config module * Update rollback flag in cliconf plugins * Add rollback api for junos cliconf plugin * Update doc * Update doc
This commit is contained in:
@@ -174,6 +174,17 @@ class Cliconf(CliconfBase):
|
||||
|
||||
return resp
|
||||
|
||||
@configure
|
||||
def rollback(self, rollback_id, commit=True):
|
||||
resp = {}
|
||||
self.send_command('rollback %s' % int(rollback_id))
|
||||
resp['diff'] = self.compare_configuration()
|
||||
if commit:
|
||||
self.commit()
|
||||
else:
|
||||
self.discard_changes()
|
||||
return resp
|
||||
|
||||
def get_diff(self, rollback_id=None):
|
||||
diff = {'config_diff': None}
|
||||
response = self.compare_configuration(rollback_id=rollback_id)
|
||||
|
||||
Reference in New Issue
Block a user