Skip to content

Instantly share code, notes, and snippets.

@tylerkerr tylerkerr/setgen.py
Created Apr 25, 2016

Embed
What would you like to do?
programmatic Junos set command generation, to eliminate tedious/manual repetitive policy creation
#!/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
You can’t perform that action at this time.