# Parse attributes and update dict of scripts
for sliver in data['slivers']:
for attribute in sliver['attributes']:
# Parse attributes and update dict of scripts
for sliver in data['slivers']:
for attribute in sliver['attributes']:
- # As the name implies, when we find an attribute, we
- createVsysDir(sliver['name'])
- # add it to our list of slivers that need vsys
+ _restart = createVsysDir(sliver['name']) or _restart
logger.log("vsys: restarting vsys service")
os.system("/etc/init.d/vsys restart")
def createVsysDir(sliver):
'''Create /vsys directory in slice. Update vsys conf file.'''
logger.log("vsys: restarting vsys service")
os.system("/etc/init.d/vsys restart")
def createVsysDir(sliver):
'''Create /vsys directory in slice. Update vsys conf file.'''
# ingore scripts that start with local_
if file.startswith("local_"): continue
if file.endswith(".acl"):
# ingore scripts that start with local_
if file.startswith("local_"): continue
if file.endswith(".acl"):
for file in files:
if file.endswith(".acl") and not file.startswith("local_"):
f = open(root+"/"+file,"r+")
for file in files:
if file.endswith(".acl") and not file.startswith("local_"):
f = open(root+"/"+file,"r+")
scriptacls[scriptname] = []
for slice in f.readlines():
scriptacls[scriptname].append(slice.rstrip())
scriptacls[scriptname] = []
for slice in f.readlines():
scriptacls[scriptname].append(slice.rstrip())