Created
April 25, 2016 23:29
-
-
Save tylerkerr/f6c99e83e94b13b02af0911ba7bfb9e3 to your computer and use it in GitHub Desktop.
programmatic Junos set command generation, to eliminate tedious/manual repetitive policy creation
This file contains 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
#!/usr/bin/env python3 | |
basecommand = input('Enter base command, with "%" in place of iterables: ') | |
start = int(input('Enter range start (inclusive): ')) | |
end = int(input('Enter range end (inclusive): ')) | |
print("\n") | |
for i in range(start,end+1): | |
print(basecommand.replace("%", str(i))) | |
# print("\n%s" % basecommand) | |
print("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment