-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #55: Check commit comment length #56
Conversation
Raise an InvalidInputError when the commit message is longer than 60 characters, as this breaks IOS-XR.
pyIOSXR/iosxr.py
Outdated
if len(comment) <= 60: | ||
rpc_command += ' Comment="%s"' % comment | ||
else: | ||
raise InvalidInputError('comment needs to be shorter than 60 characters', self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be up to and including 60 characters
Rephrase the commit comment error to better reflect the limits.
1 similar comment
Thanks to @loverend for the reworded message. |
pyIOSXR/iosxr.py
Outdated
if len(comment) <= 60: | ||
rpc_command += ' Comment="%s"' % comment | ||
else: | ||
raise InvalidInputError('comment should be no more than 60 characters', self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just trim the commit message when it's longer than 60 characters.
Instead of raising an exception, just truncate the comment length to the maximum of 60
Raise an InvalidInputError when the commit message is longer than 60 characters, as this breaks IOS-XR.