diff --git a/dnsmasq-dhcpd-dynamic/smd.py b/dnsmasq-dhcpd-dynamic/smd.py index ca3ef38..579370a 100644 --- a/dnsmasq-dhcpd-dynamic/smd.py +++ b/dnsmasq-dhcpd-dynamic/smd.py @@ -11,8 +11,9 @@ def getSMD(url): return data def getNID(c_data, xname): - node_prefix = os.environ['node_prefix'] - if not node_prefix: + if 'node_prefix' in os.environ: + node_prefix = os.environ['node_prefix'] + else: node_prefix="nid" for c in c_data: if xname == c['ID']: