def GetSlivers(data):
- """For each sliver with the codemux attribute, parse out "host,port" and make entry in conf. Restart service after."""
+ """
+ For each sliver with the codemux attribute, parse out "host,port"
+ and make entry in conf. Restart service after.
+ """
logger.log("codemux: Starting.", 2)
# slices already in conf
slicesinconf = parseConf()
# Parse attributes and update dict of scripts
for sliver in data['slivers']:
for attribute in sliver['attributes']:
- if attribute['name'] == 'codemux':
+ if attribute['tagname'] == 'codemux':
# add to conf. Attribute is [host, port]
params = {'host': attribute['value'].split(",")[0],
'port': attribute['value'].split(",")[1]}
for sliver in data['slivers']:
for attribute in sliver['attributes']:
- if attribute['name'] == 'proper_op':
+ if attribute['tagname'] == 'proper_op':
buf += "%s: %s\n" % (sliver['name'], attribute['value'])
try: os.makedirs("/etc/proper")
# convert attributes field to a proper dict
attr_dict = {}
- for attr in rec.pop('attributes'): attr_dict[attr['name']] = attr['value']
+ for attr in rec.pop('attributes'): attr_dict[attr['tagname']] = attr['value']
# squash keys
keys = rec.pop('keys')
# Parse attributes and update dict of scripts
for sliver in data['slivers']:
for attribute in sliver['attributes']:
- if attribute['name'] == 'vsys':
+ if attribute['tagname'] == 'vsys':
if sliver['name'] not in slices:
# add to conf
slices.append(sliver['name'])