This separates it from the option parser, which I want to move and
rewrite.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
complaints=0
if len(sys.argv)<2:
complaints=0
if len(sys.argv)<2:
- pfile("stdin",sys.stdin.readlines())
of=sys.stdout
else:
if sys.argv[1]=='-u':
of=sys.stdout
else:
if sys.argv[1]=='-u':
if not ok:
print "caller not in group %s"%group
sys.exit(1)
if not ok:
print "caller not in group %s"%group
sys.exit(1)
- headerinput=pfilepath(header,allow_include=True)
- userinput=sys.stdin.readlines()
- pfile("user input",userinput)
else:
if sys.argv[1]=='-P':
prefix=sys.argv[2]
else:
if sys.argv[1]=='-P':
prefix=sys.argv[2]
if len(sys.argv)>3:
print "Too many arguments"
sys.exit(1)
if len(sys.argv)>3:
print "Too many arguments"
sys.exit(1)
of=sys.stdout
if len(sys.argv)>2:
of=open(sys.argv[2],'w')
of=sys.stdout
if len(sys.argv)>2:
of=open(sys.argv[2],'w')
delempty(n.children[i])
if not live(n.children[i]):
del n.children[i]
delempty(n.children[i])
if not live(n.children[i]):
del n.children[i]
# Check that all constraints are met (as far as I can tell
# restrict-nets/networks/peer are the only special cases)
# Check that all constraints are met (as far as I can tell
# restrict-nets/networks/peer are the only special cases)
for i in n.children.keys():
checkconstraints(n.children[i],new_p,new_ra)
for i in n.children.keys():
checkconstraints(n.children[i],new_p,new_ra)
+if service:
+ headerinput=pfilepath(header,allow_include=True)
+ userinput=sys.stdin.readlines()
+ pfile("user input",userinput)
+else:
+ if inputfile is None:
+ pfile("stdin",sys.stdin.readlines())
+ else:
+ pfilepath(inputfile)
+
+delempty(root)
checkconstraints(root,{},ipaddrset.complete_set())
if complaints>0:
checkconstraints(root,{},ipaddrset.complete_set())
if complaints>0: