chiark
/
gitweb
/
~ianmdlvl
/
secnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
subdirmk: Change stub force target to `run-main.mk'
[secnet.git]
/
make-secnet-sites
diff --git
a/make-secnet-sites
b/make-secnet-sites
index 4be0160f8e2d5a8564f8da3dc593d5464de563a2..c26cab0922e3f308f30c2dbff637150be59a3b33 100755
(executable)
--- a/
make-secnet-sites
+++ b/
make-secnet-sites
@@
-214,6
+214,7
@@
def parse_args():
global group
global user
global of
global group
global user
global of
+ global prefix
global key_prefix
ap = argparse.ArgumentParser(description='process secnet sites files')
global key_prefix
ap = argparse.ArgumentParser(description='process secnet sites files')
@@
-228,6
+229,7
@@
def parse_args():
av = ap.parse_args()
#print(repr(av), file=sys.stderr)
service = 1 if av.userv else 0
av = ap.parse_args()
#print(repr(av), file=sys.stderr)
service = 1 if av.userv else 0
+ prefix = '' if av.prefix is None else av.prefix[0]
key_prefix = av.conf_key_prefix
if service:
if len(av.arg)!=4:
key_prefix = av.conf_key_prefix
if service:
if len(av.arg)!=4:
@@
-417,7
+419,7
@@
class level:
def prop_out(self,n):
return self.allow_properties[n](n,str(self.properties[n]))
def output_props(self,w,ind):
def prop_out(self,n):
return self.allow_properties[n](n,str(self.properties[n]))
def output_props(self,w,ind):
- for i in s
elf.properties.keys(
):
+ for i in s
orted(self.properties.keys()
):
if self.allow_properties[i]:
self.indent(w,ind)
w.write("%s"%self.prop_out(i))
if self.allow_properties[i]:
self.indent(w,ind)
w.write("%s"%self.prop_out(i))
@@
-430,7
+432,8
@@
class level:
w.write("%s {\n"%(self.kname()))
self.output_props(w,ind+2)
if self.depth==1: w.write("\n");
w.write("%s {\n"%(self.kname()))
self.output_props(w,ind+2)
if self.depth==1: w.write("\n");
- for c in self.children.values():
+ for k in sorted(self.children.keys()):
+ c=self.children[k]
c.output_data(w,path+(c,))
self.indent(w,ind)
w.write("};\n")
c.output_data(w,path+(c,))
self.indent(w,ind)
w.write("};\n")
@@
-533,11
+536,6
@@
class sitelevel(level):
# (depth,properties)
levels={'vpn':vpnlevel, 'location':locationlevel, 'site':sitelevel}
# (depth,properties)
levels={'vpn':vpnlevel, 'location':locationlevel, 'site':sitelevel}
-# Reserved vpn/location/site names
-reserved={'all-sites':None}
-reserved.update(keywords)
-reserved.update(levels)
-
def complain(msg):
"Complain about a particular input line"
global complaints
def complain(msg):
"Complain about a particular input line"
global complaints
@@
-558,7
+556,6
@@
root=level([UntaintedRoot(x) for x in ['root','root']])
# All vpns are children of this node
obstack=[root]
allow_defs=0 # Level above which new definitions are permitted
# All vpns are children of this node
obstack=[root]
allow_defs=0 # Level above which new definitions are permitted
-prefix=''
def set_property(obj,w):
"Set a property on a configuration node"
def set_property(obj,w):
"Set a property on a configuration node"