mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 19:28:00 +00:00
LFUtils.py: slightly better string manipulation for name series
This commit is contained in:
@@ -281,16 +281,16 @@ def port_name_series(prefix="sta", start_id=0, end_id=1, padding_number=10000, r
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
eid = None
|
eid = None
|
||||||
if radio != None:
|
if radio is not None:
|
||||||
eid = name_to_eid(radio)
|
eid = name_to_eid(radio)
|
||||||
|
|
||||||
name_list = []
|
name_list = []
|
||||||
for i in range((padding_number + start_id), (padding_number + end_id + 1)):
|
for i in range((padding_number + start_id), (padding_number + end_id + 1)):
|
||||||
sta_name = prefix + str(i)[1:]
|
sta_name = "%s%s" % (prefix, str(i)[1:])
|
||||||
if eid != None:
|
if eid is None:
|
||||||
name_list.append("%i.%i.%s"%(eid[0], eid[1], sta_name))
|
|
||||||
else:
|
|
||||||
name_list.append(sta_name)
|
name_list.append(sta_name)
|
||||||
|
else:
|
||||||
|
name_list.append("%i.%i.%s" % (eid[0], eid[1], sta_name))
|
||||||
return name_list
|
return name_list
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user