sta_connect2: Make the mgr argument on sta_connect2 more robust

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
Matthew Stidham
2021-11-29 12:56:11 -08:00
parent 3423dd0d73
commit b3d9447c7e

View File

@@ -398,8 +398,6 @@ class StaConnect2(LFCliBase):
def main():
lfjson_host = "localhost"
lfjson_port = 8080
parser = argparse.ArgumentParser(
prog="sta_connect2.py",
formatter_class=argparse.RawTextHelpFormatter,
@@ -407,8 +405,8 @@ def main():
Example:
./sta_connect2.py --dest 192.168.100.209 --dut_ssid OpenWrt-2 --dut_bssid 24:F5:A2:08:21:6C
""")
parser.add_argument("-d", "--dest", type=str, help="address of the LANforge GUI machine (localhost is default)")
parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)")
parser.add_argument("-d", "--dest", "--mgr", type=str, help="address of the LANforge GUI machine (localhost is default)", default='localhost')
parser.add_argument("-o", "--port", type=int, help="IP Port the LANforge GUI is listening on (8080 is default)", default=8080)
parser.add_argument("-u", "--user", type=str, help="TBD: credential login/username")
parser.add_argument("-p", "--passwd", type=str, help="TBD: credential password")
parser.add_argument("--resource", type=str, help="LANforge Station resource ID to use, default is 1")
@@ -434,12 +432,8 @@ Example:
parser.add_argument('--monitor_interval', help='How frequently you want to append to your database', default='5s')
args = parser.parse_args()
if args.dest is not None:
lfjson_host = args.dest
if args.port is not None:
lfjson_port = args.port
staConnect = StaConnect2(lfjson_host, lfjson_port,
staConnect = StaConnect2(args.dest, args.port,
debug_=True,
_influx_db=args.influx_db,
_influx_passwd=args.influx_passwd,