Skip to content

Commit

Permalink
Merge pull request #52 from fooelisa/revert-46-master
Browse files Browse the repository at this point in the history
Revert "Fixed the syntax error from my pull request earlier"
  • Loading branch information
mirceaulinic authored Jul 25, 2017
2 parents 52a6f52 + 7e0cc92 commit d8e7f09
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 44 deletions.
20 changes: 10 additions & 10 deletions pyIOSXR/iosxr.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,17 +582,17 @@ def commit_config(self, label=None, comment=None, confirmed=None):
:param comment: Commit label, displayed instead of the commit ID on the device.
:param confirmed: Commit with auto-rollback if new commit is not made in 30 to 300 sec
"""
rpc_command = '<CLI><Configuration>commit'
rpc_command = '<Commit'
if label:
rpc_command += ' label %s' % label
rpc_command += ' Label="%s"' % label
if comment:
rpc_command += ' comment %s' % comment
rpc_command += ' Comment="%s"' % comment
if confirmed:
if 30 <= int(confirmed) <= 300:
rpc_command += ' confirmed %d' % int(confirmed)
rpc_command += ' Confirmed="%d"' % int(confirmed)
else:
raise InvalidInputError('confirmed needs to be between 30 and 300 seconds', self)
rpc_command += '</Configuration></CLI>'
rpc_command += '/>'

self._execute_rpc(rpc_command)

Expand All @@ -604,17 +604,17 @@ def commit_replace_config(self, label=None, comment=None, confirmed=None):
:param label: User label saved on this commit on the device
:param confirmed: Commit with auto-rollback if new commit is not made in 30 to 300 sec
"""
rpc_command = '<CLI><Configuration>commit replace'
rpc_command = '<Commit Replace="true"'
if label:
rpc_command += ' label %s' % label
rpc_command += ' Label="%s"' % label
if comment:
rpc_command += ' comment %s' % comment
rpc_command += ' Comment="%s"' % comment
if confirmed:
if 30 <= int(confirmed) <= 300:
rpc_command += ' confirmed %d' % int(confirmed)
rpc_command += ' Confirmed="%d"' % int(confirmed)
else:
raise InvalidInputError('confirmed needs to be between 30 and 300 seconds', self)
rpc_command += '</Configuration></CLI>'
rpc_command += '/>'
self._execute_rpc(rpc_command)

def discard_config(self):
Expand Down
3 changes: 0 additions & 3 deletions test/mock/CLI_Configuration_commitConfiguration_CLI_.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit d8e7f09

Please sign in to comment.