Skip to content

Commit

Permalink
Merge pull request #971 from odeshog/fix/config-diff-warnings
Browse files Browse the repository at this point in the history
option to ignore warnings in config diff
  • Loading branch information
Nitin Kr authored Jan 10, 2020
2 parents a2ebb55 + 1f2ebd8 commit e9e6dc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/jnpr/junos/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def commit_check(self):
# show | compare rollback <number|0*>
# -------------------------------------------------------------------------

def diff(self, rb_id=0):
def diff(self, rb_id=0, ignore_warning=False):
"""
Retrieve a diff (patch-format) report of the candidate config against
either the current active config, or a different rollback.
Expand All @@ -224,9 +224,9 @@ def diff(self, rb_id=0):
raise ValueError("Invalid rollback #" + str(rb_id))

try:
rsp = self.rpc.get_configuration(dict(
compare='rollback', rollback=str(rb_id), format='text'
))
rsp = self.rpc.get_configuration(
dict(compare='rollback', rollback=str(rb_id), format='text'),
ignore_warning=ignore_warning)
except RpcTimeoutError:
raise
except RpcError as err:
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/utils/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ def test_config_diff(self):
self.conf.diff()
self.conf.rpc.get_configuration.\
assert_called_with(
{'compare': 'rollback', 'rollback': '0', 'format': 'text'})
{'compare': 'rollback', 'rollback': '0', 'format': 'text'},
ignore_warning=False)

def test_config_diff_exception_severity_warning(self):
rpc_xml = '''
Expand Down

0 comments on commit e9e6dc1

Please sign in to comment.