if sliver['name'] not in slices:
# add to conf
slices.append(sliver['name'])
- # As the name implies, when we find an attribute, we
- _restart = createVsysDir(sliver['name'])
+ _restart = createVsysDir(sliver['name']) or _restart
+ # As the name implies, when we find an attribute, we
# add it to our list of slivers that need vsys
if attribute['value'] in scripts.keys():
scripts[attribute['value']].append(sliver['name'])
# Write the conf
- writeConf(slices, parseConf())
+ _restart = writeConf(slices, parseConf()) or _restart
# Write out the ACLs
if writeAcls(scripts, parseAcls()) or _restart:
logger.log("vsys: restarting vsys service")
for (root, dirs, files) in os.walk(VSYSBKEND):
for file in files:
if file.endswith(".acl"):
- acls.append(file.rstrip(".acl"))
+ acls.append(file.replace(".acl", ""))
else:
scripts.append(file)
for new in (Set(scripts) - Set(acls)):
for file in files:
if file.endswith(".acl"):
f = open(root+"/"+file,"r+")
- scriptname = file.rstrip(".acl")
+ scriptname = file.replace(".acl", "")
scriptacls[scriptname] = []
for slice in f.readlines():
scriptacls[scriptname].append(slice.rstrip())
f.write("/vservers/%(name)s/vsys %(name)s\n" % {"name": sliver})
f.truncate()
f.close()
+ return True
+ else:
+ return False
def parseConf():