Add support for commit label in iosxr_config (#42931)

* Add support for commit label in iosxr_config

* sanity pep8 etc fixes
This commit is contained in:
Deepak Agrawal 2018-07-24 17:16:26 +05:30 committed by GitHub
parent 4f1746ee1d
commit bf544c2200
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 130 additions and 8 deletions

View file

@ -89,9 +89,13 @@ class Cliconf(CliconfBase):
def get(self, command=None, prompt=None, answer=None, sendonly=False, newline=True):
return self.send_command(command=command, prompt=prompt, answer=answer, sendonly=sendonly, newline=newline)
def commit(self, comment=None):
if comment:
def commit(self, comment=None, label=None):
if comment and label:
command = 'commit label {0} comment {1}'.format(label, comment)
elif comment:
command = 'commit comment {0}'.format(comment)
elif label:
command = 'commit label {0}'.format(label)
else:
command = 'commit'
self.send_command(command)