From ae2c0aa697623767bb9bdd80a659cb5853184e5d Mon Sep 17 00:00:00 2001 From: "Blake J. Harnden" Date: Thu, 16 Aug 2018 12:20:56 -0700 Subject: [PATCH] fixed issue with loading custom service directories from xml, fixed issue with parsing an empty tuple string in utility method --- daemon/core/misc/utils.py | 6 +++++- daemon/core/xml/corexml.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/daemon/core/misc/utils.py b/daemon/core/misc/utils.py index e20ecd3c..9cf769ea 100644 --- a/daemon/core/misc/utils.py +++ b/daemon/core/misc/utils.py @@ -132,7 +132,11 @@ def make_tuple_fromstr(s, value_type): :rtype: tuple """ # remove tuple braces and strip commands and space from all values in the tuple string - values = [x.strip("' ") for x in s.strip("(), ").split(",")] + values = [] + for x in s.strip("(), ").split(","): + x = x.strip("' ") + if x: + values.append(x) return tuple(value_type(i) for i in values) diff --git a/daemon/core/xml/corexml.py b/daemon/core/xml/corexml.py index 26261318..9e4bb858 100644 --- a/daemon/core/xml/corexml.py +++ b/daemon/core/xml/corexml.py @@ -764,7 +764,7 @@ class CoreXmlReader(object): directory_elements = service_configuration.find("directories") if directory_elements is not None: - service.directories = tuple(x.text for x in directory_elements.iterchildren()) + service.dirs = tuple(x.text for x in directory_elements.iterchildren()) startup_elements = service_configuration.find("startups") if startup_elements is not None: