fixed issue with configuring a couple nrl services, fixed other issues with coresendmsg

This commit is contained in:
Blake J. Harnden 2018-03-26 14:36:43 -07:00
parent 4c35aaaa48
commit 64f501ac79
3 changed files with 5 additions and 6 deletions

View file

@ -639,7 +639,7 @@ class CoreServices(ConfigurableManager):
# get the file data # get the file data
data = self.getservicefiledata(svc, filename) data = self.getservicefiledata(svc, filename)
if data is None: if data is None:
data = "%s" % (svc.generateconfig(node, filename, services)) data = "%s" % svc.generateconfig(node, filename, services)
else: else:
data = "%s" % data data = "%s" % data
filetypestr = "service:%s" % svc._name filetypestr = "service:%s" % svc._name

View file

@ -126,7 +126,7 @@ class NrlSmf(NrlService):
servicenames = map(lambda x: x._name, services) servicenames = map(lambda x: x._name, services)
netifs = filter(lambda x: not getattr(x, 'control', False), node.netifs()) netifs = filter(lambda x: not getattr(x, 'control', False), node.netifs())
if len(netifs) == 0: if len(netifs) == 0:
return () return ""
if "arouted" in servicenames: if "arouted" in servicenames:
comments += "# arouted service is enabled\n" comments += "# arouted service is enabled\n"
@ -606,7 +606,7 @@ class MgenActor(NrlService):
servicenames = map(lambda x: x._name, services) servicenames = map(lambda x: x._name, services)
netifs = filter(lambda x: not getattr(x, 'control', False), node.netifs()) netifs = filter(lambda x: not getattr(x, 'control', False), node.netifs())
if len(netifs) == 0: if len(netifs) == 0:
return () return ""
cfg += comments + cmd + " < /dev/null > /dev/null 2>&1 &\n\n" cfg += comments + cmd + " < /dev/null > /dev/null 2>&1 &\n\n"
return cfg return cfg

View file

@ -229,12 +229,11 @@ def main():
continue continue
tlv_name = tlv_typestr tlv_name = tlv_typestr
tlv_type = tlv_cls[tlv_name].value
try: try:
tlv_cls.tlv_type_map[tlv_name] tlv_type = tlv_cls.tlv_type_map[tlv_name]
tlvdata += tlv_cls.pack_string(tlv_type.value, tlv_valstr)
except KeyError: except KeyError:
usage("Unknown TLV: \"%s\"" % tlv_name) usage("Unknown TLV: \"%s\"" % tlv_name)
tlvdata += tlv_cls.pack_string(tlv_type, tlv_valstr)
flags = 0 flags = 0
for f in flagstr.split(","): for f in flagstr.split(","):