git://git.onelab.eu
/
nodemanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
expects the 'interfaces' key in GetSlivers - review logs to always mention module
[nodemanager.git]
/
plugins
/
vsys.py
diff --git
a/plugins/vsys.py
b/plugins/vsys.py
index
3effa58
..
ee806e7
100644
(file)
--- a/
plugins/vsys.py
+++ b/
plugins/vsys.py
@@
-11,10
+11,15
@@
VSYSCONF="/etc/vsys.conf"
VSYSBKEND="/vsys"
def start(options, conf):
VSYSBKEND="/vsys"
def start(options, conf):
- pass
+ logger.log("vsys: plugin starting up...")
-def GetSlivers(
plc, data, config
=None):
+def GetSlivers(
data, config=None, plc
=None):
"""For each sliver with the vsys attribute, set the script ACL, create the vsys directory in the slice, and restart vsys."""
"""For each sliver with the vsys attribute, set the script ACL, create the vsys directory in the slice, and restart vsys."""
+
+ if 'slivers' not in data:
+ logger.log_missing_data("vsys.GetSlivers",'slivers')
+ return
+
# Touch ACLs and create dict of available
scripts = {}
for script in touchAcls(): scripts[script] = []
# Touch ACLs and create dict of available
scripts = {}
for script in touchAcls(): scripts[script] = []
@@
-22,6
+27,9
@@
def GetSlivers(plc, data, config=None):
slices = []
_restart = False
# Parse attributes and update dict of scripts
slices = []
_restart = False
# Parse attributes and update dict of scripts
+ if 'slivers' not in data:
+ logger.log_missing_data("vsys.GetSlivers",'slivers')
+ return
for sliver in data['slivers']:
for attribute in sliver['attributes']:
if attribute['tagname'] == 'vsys':
for sliver in data['slivers']:
for attribute in sliver['attributes']:
if attribute['tagname'] == 'vsys':
@@
-137,5
+145,5
@@
def parseConf():
(path, slice) = line.split()
slicesinconf.append(slice)
f.close()
(path, slice) = line.split()
slicesinconf.append(slice)
f.close()
- except: logger.log_exc()
+ except: logger.log_exc(
"vsys: failed parseConf"
)
return slicesinconf
return slicesinconf