Skip to content

Commit d8e7f09

Browse files
authored
Merge pull request #52 from fooelisa/revert-46-master
Revert "Fixed the syntax error from my pull request earlier"
2 parents 52a6f52 + 7e0cc92 commit d8e7f09

12 files changed

+10
-44
lines changed

pyIOSXR/iosxr.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -582,17 +582,17 @@ def commit_config(self, label=None, comment=None, confirmed=None):
582582
:param comment: Commit label, displayed instead of the commit ID on the device.
583583
:param confirmed: Commit with auto-rollback if new commit is not made in 30 to 300 sec
584584
"""
585-
rpc_command = '<CLI><Configuration>commit'
585+
rpc_command = '<Commit'
586586
if label:
587-
rpc_command += ' label %s' % label
587+
rpc_command += ' Label="%s"' % label
588588
if comment:
589-
rpc_command += ' comment %s' % comment
589+
rpc_command += ' Comment="%s"' % comment
590590
if confirmed:
591591
if 30 <= int(confirmed) <= 300:
592-
rpc_command += ' confirmed %d' % int(confirmed)
592+
rpc_command += ' Confirmed="%d"' % int(confirmed)
593593
else:
594594
raise InvalidInputError('confirmed needs to be between 30 and 300 seconds', self)
595-
rpc_command += '</Configuration></CLI>'
595+
rpc_command += '/>'
596596

597597
self._execute_rpc(rpc_command)
598598

@@ -604,17 +604,17 @@ def commit_replace_config(self, label=None, comment=None, confirmed=None):
604604
:param label: User label saved on this commit on the device
605605
:param confirmed: Commit with auto-rollback if new commit is not made in 30 to 300 sec
606606
"""
607-
rpc_command = '<CLI><Configuration>commit replace'
607+
rpc_command = '<Commit Replace="true"'
608608
if label:
609-
rpc_command += ' label %s' % label
609+
rpc_command += ' Label="%s"' % label
610610
if comment:
611-
rpc_command += ' comment %s' % comment
611+
rpc_command += ' Comment="%s"' % comment
612612
if confirmed:
613613
if 30 <= int(confirmed) <= 300:
614-
rpc_command += ' confirmed %d' % int(confirmed)
614+
rpc_command += ' Confirmed="%d"' % int(confirmed)
615615
else:
616616
raise InvalidInputError('confirmed needs to be between 30 and 300 seconds', self)
617-
rpc_command += '</Configuration></CLI>'
617+
rpc_command += '/>'
618618
self._execute_rpc(rpc_command)
619619

620620
def discard_config(self):

test/mock/CLI_Configuration_commitConfiguration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_comment_emptyConfiguration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_comment_goodConfiguration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_comment_parallelConfiguration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_comment_pyIOSXR-test_xml-agent-iteration-onConfiguration_CLI_.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_confirmed_60Configuration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_label_testConfiguration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_replaceConfiguration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_replace_comment_goodConfiguration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_replace_confirmed_60Configuration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/mock/CLI_Configuration_commit_replace_label_testConfiguration_CLI_.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)