mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 03:07:56 +00:00
realm.py: improves delay for rm port and rm port formatting
This commit is contained in:
@@ -128,18 +128,18 @@ class Realm(LFCliBase):
|
|||||||
|
|
||||||
def rm_port(self, port_eid, check_exists=True):
|
def rm_port(self, port_eid, check_exists=True):
|
||||||
req_url = "/cli-json/rm_vlan"
|
req_url = "/cli-json/rm_vlan"
|
||||||
data = {}
|
|
||||||
|
|
||||||
eid = self.name_to_eid(port_eid)
|
eid = self.name_to_eid(port_eid)
|
||||||
do_rm = True;
|
do_rm = True;
|
||||||
if check_exists:
|
if check_exists:
|
||||||
if not self.port_exists(port_eid):
|
if not self.port_exists(port_eid):
|
||||||
do_rm = False
|
do_rm = False
|
||||||
if do_rm:
|
if do_rm:
|
||||||
data["shelf"] = eid[0]
|
data = {
|
||||||
data["resource"] = eid[1]
|
"shelf": eid[0],
|
||||||
data["port"] = eid[2]
|
"resource": eid[1],
|
||||||
self.json_post(req_url, data, debug_=True) #self.debug)
|
"port": eid[2]
|
||||||
|
}
|
||||||
|
rsp = self.json_post(req_url, data, debug_=self.debug)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -1985,10 +1985,11 @@ class StationProfile:
|
|||||||
if not current_stations is None:
|
if not current_stations is None:
|
||||||
found_one = True
|
found_one = True
|
||||||
self.local_realm.rm_port(port_eid, check_exists=False)
|
self.local_realm.rm_port(port_eid, check_exists=False)
|
||||||
|
time.sleep(delay)
|
||||||
if not found_one:
|
if not found_one:
|
||||||
return
|
return
|
||||||
count = count + 1
|
count = count + 1
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
# Checks for errors in initialization values and creates specified number of stations using init parameters
|
# Checks for errors in initialization values and creates specified number of stations using init parameters
|
||||||
def create(self, radio, num_stations=0, sta_names_=None, dry_run=False, up_=None, debug=False, suppress_related_commands_=True, sleep_time=2):
|
def create(self, radio, num_stations=0, sta_names_=None, dry_run=False, up_=None, debug=False, suppress_related_commands_=True, sleep_time=2):
|
||||||
|
|||||||
Reference in New Issue
Block a user