Skip to content
This repository was archived by the owner on Feb 28, 2019. It is now read-only.

Commit c31a110

Browse files
committed
i2smo: fixed checking for param base (dbdmn)
+ previous implementation assumed incorrectly that the base prefix has fixed size 4
1 parent 1d13fa5 commit c31a110

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

utils/i2smo

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,12 @@ def check_for_daemons(parameters):
167167
if re.search(r"dbdmn.{0,}", value):
168168
for unit in device:
169169
for param in unit:
170-
found_param_base = False
171-
for attrib, value in param.items():
172-
if attrib == namespace_extra + "param" is not None:
173-
base = re.search(r".{4}", value)
174-
if os.path.exists("/opt/szarp/" + base.group(0)):
175-
found_param_base = True
176-
if found_param_base is False:
177-
printerr("extra:param base doesn't exist (line " + str(param.sourceline) + ")")
170+
param_path = param.get(namespace_extra + "param")
171+
if param_path is not None:
172+
base = re.search(r"(?P<base>[^:]*):", param_path).group("base")
173+
base_path = "/opt/szarp/" + base
174+
if not os.path.exists(base_path):
175+
printerr("extra:param base '%s' doesn't exist (line %d)" % (base, param.sourceline))
178176

179177
def check_send_elements(parameters):
180178
namespace = "{http://www.praterm.com.pl/SZARP/ipk}"

0 commit comments

Comments
 (0)