From 7132259e391162c6a6fd96f6073b2c7aad5f982d Mon Sep 17 00:00:00 2001 From: jitendracandela Date: Tue, 29 Nov 2022 00:29:03 +0530 Subject: [PATCH] Fixed Station not connected to applied channel issue Signed-off-by: jitendracandela --- lf_libs/lf_libs.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lf_libs/lf_libs.py b/lf_libs/lf_libs.py index 96ac2596..95da6d07 100644 --- a/lf_libs/lf_libs.py +++ b/lf_libs/lf_libs.py @@ -974,13 +974,21 @@ class lf_libs: sta_dict = {} try: for sta in sta_name: - time.sleep(4) sta_url = "port/" + str(sta.split(".")[0]) + "/" + str(sta.split(".")[1]) + "/" + str(sta.split(".")[2]) station_info = self.json_get(sta_url) dict_data = station_info["interface"] temp_dict = {} for i in rows: temp_dict[i] = dict_data[i] + if i == "channel": + if dict_data[i] == "-1": + self.local_realm.reset_port(sta) + time.sleep(5) + sta_url_ = "port/" + str(sta.split(".")[0]) + "/" + str(sta.split(".")[1]) + "/" + str( + sta.split(".")[2]) + station_info_ = self.json_get(sta_url_) + dict_data_ = station_info_["interface"] + temp_dict[i] = dict_data_[i] sta_dict[sta] = temp_dict except Exception as e: logging.error(e)