[DNM] Fixed issue where new/empty lines are stripped at the top of a banner#1237
Draft
derrickma06 wants to merge 1 commit into
Draft
[DNM] Fixed issue where new/empty lines are stripped at the top of a banner#1237derrickma06 wants to merge 1 commit into
derrickma06 wants to merge 1 commit into
Conversation
Contributor
|
@derrickma06 thanks for working on this issue, currently this is not in our priority and we are not planning to work on this for some time atleast! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Fixes #1178
This change allows banner text to have leading empty lines ("\n") which can be helpful for formatting. Before this change, this was not possible because the empty lines would be stripped before being converted into a CLI command.
ISSUE TYPE
COMPONENT NAME
ios_banner
ADDITIONAL INFORMATION
The fix was to change a .strip(“\n”) call to .rstrip(“\n”) within the map_obj_to_commands function in the ios_banner.py file. Calling strip would remove any leading and trailing empty lines in the banner text, but changing it to rstrip would only remove trailing empty lines and keep the leading lines, allowing for clean space and formatting in the ASCII art banner.
For example, take the following playbook:
Before the change, this would result in the following command being inputted to the device:
The empty lines in the beginning of the banner that were specified in the playbook were removed.
After the change, this is the command that is inputted to the device:
This output now has the leading empty lines included in the banner.