diff --git a/py-scripts/stations_connected.py b/py-scripts/stations_connected.py index 0ce91c89..0436156c 100755 --- a/py-scripts/stations_connected.py +++ b/py-scripts/stations_connected.py @@ -9,7 +9,6 @@ if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) - sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../"))) lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") @@ -28,7 +27,7 @@ class StationsConnected(LFCliBase): self.clear_test_results() fields = "_links,port,alias,ip,ap,port+type" self.station_results = self.localrealm.find_ports_like("sta*", fields, debug_=False) - #pprint(self.station_results) + # pprint(self.station_results) if (self.station_results is None) or (len(self.station_results) < 1): self.get_failed_result_list() return False @@ -37,15 +36,16 @@ class StationsConnected(LFCliBase): def num_associated(self, bssid): counter = 0 # print("there are %d results" % len(self.station_results)) - for eid,record in self.station_results.items(): - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - #pprint(eid) - #pprint(record) + for eid, record in self.station_results.items(): + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # pprint(eid) + # pprint(record) if record["ap"] == bssid: counter += 1 - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") + # print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") return counter + def main(): parser = argparse.ArgumentParser( prog='stations_connected.py', @@ -60,7 +60,6 @@ Contains examples of using realm to query stations and get specific information # if args are added args=parser.parse_args() swap out next line parser.parse_args() - qstationsx = StationsConnected("localhost", 8080) bssid = "00:0E:8E:7B:DF:9B" if qstationsx.run(): @@ -69,5 +68,6 @@ Contains examples of using realm to query stations and get specific information else: print("problem querying for stations for %s" % bssid) + if __name__ == "__main__": main()