From 64f501ac7947d923a627c71d64c22d8f73d47601 Mon Sep 17 00:00:00 2001 From: "Blake J. Harnden" Date: Mon, 26 Mar 2018 14:36:43 -0700 Subject: [PATCH] fixed issue with configuring a couple nrl services, fixed other issues with coresendmsg --- daemon/core/service.py | 2 +- daemon/core/services/nrl.py | 4 ++-- daemon/scripts/coresendmsg | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/daemon/core/service.py b/daemon/core/service.py index 34863afa..47e6eb99 100644 --- a/daemon/core/service.py +++ b/daemon/core/service.py @@ -639,7 +639,7 @@ class CoreServices(ConfigurableManager): # get the file data data = self.getservicefiledata(svc, filename) if data is None: - data = "%s" % (svc.generateconfig(node, filename, services)) + data = "%s" % svc.generateconfig(node, filename, services) else: data = "%s" % data filetypestr = "service:%s" % svc._name diff --git a/daemon/core/services/nrl.py b/daemon/core/services/nrl.py index a2afbfba..6661ec49 100644 --- a/daemon/core/services/nrl.py +++ b/daemon/core/services/nrl.py @@ -126,7 +126,7 @@ class NrlSmf(NrlService): servicenames = map(lambda x: x._name, services) netifs = filter(lambda x: not getattr(x, 'control', False), node.netifs()) if len(netifs) == 0: - return () + return "" if "arouted" in servicenames: comments += "# arouted service is enabled\n" @@ -606,7 +606,7 @@ class MgenActor(NrlService): servicenames = map(lambda x: x._name, services) netifs = filter(lambda x: not getattr(x, 'control', False), node.netifs()) if len(netifs) == 0: - return () + return "" cfg += comments + cmd + " < /dev/null > /dev/null 2>&1 &\n\n" return cfg diff --git a/daemon/scripts/coresendmsg b/daemon/scripts/coresendmsg index 2f8e3495..be6e030b 100755 --- a/daemon/scripts/coresendmsg +++ b/daemon/scripts/coresendmsg @@ -229,12 +229,11 @@ def main(): continue tlv_name = tlv_typestr - tlv_type = tlv_cls[tlv_name].value 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: usage("Unknown TLV: \"%s\"" % tlv_name) - tlvdata += tlv_cls.pack_string(tlv_type, tlv_valstr) flags = 0 for f in flagstr.split(","):