From 30e4bbc38bac004b9ff89cc8f17e550f5f1669e2 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Mon, 15 Feb 2021 16:46:39 -0800 Subject: [PATCH] LFUtils: restricts input to string --- py-json/LANforge/LFUtils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index 585d8357..6fa20178 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -488,7 +488,9 @@ def name_to_eid(input): info = [] if (input is None) or (input == ""): raise ValueError("name_to_eid wants eid like 1.1.sta0 but given[%s]" % input) - + if type(input) is not str: + raise ValueError("name_to_eid wants string formatted like '1.2.name', not a tuple or list") + info = input.split('.') if len(info) == 1: rv[2] = info[0]; # just port name