These go away in python3. They want us to use this daft objecty
syntax instead.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
sys.exit(1)
ugs=os.environ["USERV_GROUP"]
ok=0
sys.exit(1)
ugs=os.environ["USERV_GROUP"]
ok=0
- for i in string.split(ugs):
if group==i: ok=1
if not ok:
print("caller not in group %s"%group)
if group==i: ok=1
if not ok:
print("caller not in group %s"%group)
w.write("\n")
self.indent(w,ind+2)
w.write("all-sites %s;\n"%
w.write("\n")
self.indent(w,ind+2)
w.write("all-sites %s;\n"%
- string.join(self.children.keys(),','))
+ ','.join(self.children.keys()))
self.indent(w,ind)
w.write("};\n")
self.indent(w,ind)
w.write("};\n")
self.indent(w,ind)
# The "h=h,self=self" abomination below exists because
# Python didn't support nested_scopes until version 2.1
self.indent(w,ind)
# The "h=h,self=self" abomination below exists because
# Python didn't support nested_scopes until version 2.1
- w.write("%s %s;\n"%(self.name,string.join(
+ w.write("%s %s;\n"%(self.name,','.join(
map(lambda x,h=h,self=self:
map(lambda x,h=h,self=self:
- h+"/"+x,self.children.keys()),',')))
+ h+"/"+x,self.children.keys()))))
class sitelevel(level):
"Site level (i.e. a leafnode) in the configuration hierarchy"
class sitelevel(level):
"Site level (i.e. a leafnode) in the configuration hierarchy"
def pline(i,allow_include=False):
"Process a configuration file line"
global allow_defs, obstack, root
def pline(i,allow_include=False):
"Process a configuration file line"
global allow_defs, obstack, root
- w=string.split(i.rstrip('\n'))
+ w=i.rstrip('\n').split()
if len(w)==0: return [i]
keyword=w[0]
current=obstack[len(obstack)-1]
if len(w)==0: return [i]
keyword=w[0]
current=obstack[len(obstack)-1]
w.write("# secnet sites file autogenerated by make-secnet-sites "
+"version %s\n"%VERSION)
w.write("# %s\n"%time.asctime(time.localtime(time.time())))
w.write("# secnet sites file autogenerated by make-secnet-sites "
+"version %s\n"%VERSION)
w.write("# %s\n"%time.asctime(time.localtime(time.time())))
- w.write("# Command line: %s\n\n"%string.join(sys.argv))
+ w.write("# Command line: %s\n\n"%' '.join(sys.argv))
# Raw VPN data section of file
w.write(prefix+"vpn-data {\n")
# Raw VPN data section of file
w.write(prefix+"vpn-data {\n")
w.write("};\n")
# Flattened list of sites
w.write("};\n")
# Flattened list of sites
- w.write(prefix+"all-sites %s;\n"%string.join(
+ w.write(prefix+"all-sites %s;\n"%",".join(
map(lambda x:"%svpn/%s/all-sites"%(prefix,x),
map(lambda x:"%svpn/%s/all-sites"%(prefix,x),
- root.children.keys()),","))
+ root.children.keys())))