+# $Id$
+# $URL$
+
"""
vsys sub-configurator. Maintains configuration parameters associated with vsys scripts.
All slice attributes with the prefix vsys_ are written into configuration files on the
VSYS_PRIV_DIR = "/etc/planetlab/vsys-attributes"
def start(options, conf):
- logger.log("vsys_privs plugin v0.1")
+ logger.log("vsys_privs: plugin starting")
if (not os.path.exists(VSYS_PRIV_DIR)):
os.makedirs(VSYS_PRIV_DIR)
- logger.log("Created vsys attributes dir")
+ logger.log("vsys_privs: Created vsys attributes dir")
def GetSlivers(data, config=None, plc=None):
+
+ if 'slivers' not in data:
+ logger.log_missing_data("vsys_privs.GetSlivers",'slivers')
+ return
+
+
privs = {}
# Parse attributes and update dict of scripts
+ if 'slivers' not in data:
+ logger.log_missing_data("vsys_privs.GetSlivers",'slivers')
+ return
for sliver in data['slivers']:
slice = sliver['name']
for attribute in sliver['attributes']:
data = '\n'.join(v)
f.write(data)
f.close()
- logger.log("Added vsys attribute %s for %s")%(k,slice)
+ logger.log("vsys_privs: added vsys attribute %s for %s"%(k,slice))
# Remove files and directories
# that are invalid