mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
Add option to pass resource number eg for resource 2 [1.2.sta00]
This commit is contained in:
@@ -549,8 +549,11 @@ def waitUntilPortsAppear(base_url="http://localhost:8080", port_list=(), debug=F
|
||||
"""
|
||||
return wait_until_ports_appear(base_url, port_list, debug=debug)
|
||||
|
||||
def name_to_eid(input, non_port=False):
|
||||
rv = [1, 1, "", ""]
|
||||
def name_to_eid(input, non_port=False, resource=None):
|
||||
if resource is None:
|
||||
rv = [1, 1, "", ""]
|
||||
else:
|
||||
rv = [1, resource, "", ""]
|
||||
info = []
|
||||
if (input is None) or (input == ""):
|
||||
raise ValueError("name_to_eid wants eid like 1.1.sta0 but given[%s]" % input)
|
||||
|
||||
@@ -152,8 +152,8 @@ class GenCXProfile(LFCliBase):
|
||||
count = 40
|
||||
for i in range(0, count):
|
||||
port_info = self.local_realm.name_to_eid(sta_port)
|
||||
resource = port_info[0]
|
||||
shelf = port_info[1]
|
||||
resource = port_info[1]
|
||||
shelf = port_info[0]
|
||||
name = port_info[2]
|
||||
|
||||
gen_name_a = "%s-%s" % (self.name_prefix, name) + "_" + str(i) + add
|
||||
@@ -167,8 +167,8 @@ class GenCXProfile(LFCliBase):
|
||||
for i in range(0, 5):
|
||||
port_info = self.local_realm.name_to_eid(port_name)
|
||||
try:
|
||||
resource = port_info[0]
|
||||
shelf = port_info[1]
|
||||
resource = port_info[1]
|
||||
shelf = port_info[0]
|
||||
name = port_info[2]
|
||||
except:
|
||||
raise ValueError("Unexpected name for port_name %s" % port_name)
|
||||
@@ -279,8 +279,8 @@ class GenCXProfile(LFCliBase):
|
||||
endp_tpls = []
|
||||
for port_name in ports:
|
||||
port_info = self.local_realm.name_to_eid(port_name)
|
||||
resource = port_info[0]
|
||||
shelf = port_info[1]
|
||||
resource = port_info[1]
|
||||
shelf = port_info[0]
|
||||
name = port_info[2]
|
||||
|
||||
# this naming convention follows what you see when you use
|
||||
|
||||
@@ -136,6 +136,7 @@ class MACVLANProfile(LFCliBase):
|
||||
set_port.set_port_current_flags)
|
||||
self.set_port_data["interest"] = self.add_named_flags(self.desired_set_port_interest_flags,
|
||||
set_port.set_port_interest_flags)
|
||||
self.set_port_data["resource"] = self.resource
|
||||
set_port_r = LFRequest.LFRequest(self.lfclient_url + "/cli-json/set_port")
|
||||
|
||||
for i in range(len(self.desired_macvlans)):
|
||||
|
||||
@@ -582,12 +582,12 @@ class Realm(LFCliBase):
|
||||
|
||||
return matched_map
|
||||
|
||||
def name_to_eid(self, eid, debug=False, non_port=False):
|
||||
def name_to_eid(self, eid, debug=False, non_port=False, resource=None):
|
||||
if debug:
|
||||
self.logg(level="debug", mesg="name_to_eid: "+str(eid))
|
||||
if (type(eid) is list) or (type(eid) is tuple):
|
||||
return eid
|
||||
return LFUtils.name_to_eid(eid, non_port=non_port)
|
||||
return LFUtils.name_to_eid(eid, non_port=non_port, resource=None)
|
||||
|
||||
def wait_for_ip(self, station_list=None, ipv4=True, ipv6=False, timeout_sec=360, debug=False):
|
||||
if not (ipv4 or ipv6):
|
||||
|
||||
@@ -373,10 +373,11 @@ class StationProfile:
|
||||
suppress_related_commands_=True,
|
||||
use_radius=False,
|
||||
hs20_enable=False,
|
||||
sleep_time=0.02):
|
||||
sleep_time=0.02,
|
||||
resource=None):
|
||||
if (radio is None) or (radio == ""):
|
||||
raise ValueError("station_profile.create: will not create stations without radio")
|
||||
radio_eid = self.local_realm.name_to_eid(radio)
|
||||
radio_eid = self.local_realm.name_to_eid(radio, resource=resource)
|
||||
radio_shelf = radio_eid[0]
|
||||
radio_resource = radio_eid[1]
|
||||
radio_port = radio_eid[2]
|
||||
|
||||
Reference in New Issue
Block a user