From a5859d8a1231ce4bc9bc05f963ad86b42c7436e3 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 12 Nov 2020 13:04:47 -0700 Subject: [PATCH] cisco_wifi_ctt.py , lf_cisco_power.py : needed to add following commands to the controller "wireless tag policy default-policy-tag","no wlan open-wlan policy default-policy-profile" --- cisco_wifi_ctl.py | 20 +++++++++++++++++++- lf_cisco_power.py | 5 ++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/cisco_wifi_ctl.py b/cisco_wifi_ctl.py index ba54ce22..3a289b12 100755 --- a/cisco_wifi_ctl.py +++ b/cisco_wifi_ctl.py @@ -111,7 +111,7 @@ def main(): "cmd", "txPower", "bandwidth", "manual", "auto","no_wlan","show_wlan_summary", "ap_channel", "channel", "show", "create_wlan", "enable_wlan", "disable_wlan", "wlan_qos", "disable_network_5ghz","disable_network_24ghz","enable_network_5ghz","enable_network_24ghz", - "wireless_tag_policy"]) + "wireless_tag_policy","no_wlan_wireless_tag_policy"]) parser.add_argument("--value", type=str, help="set value") args = None @@ -1083,6 +1083,24 @@ def main(): else: command = "show ap channel %s"%(args.ap) + if (args.action == "no_wlan_wireless_tag_policy"): + logg.info("send wireless tag policy no wlan") + egg.sendline("config t") + sleep(0.1) + i = egg.expect_exact(["(config)#",pexpect.TIMEOUT],timeout=2) + if i == 0: + for command in ["wireless tag policy default-policy-tag","no wlan open-wlan policy default-policy-profile"]: + egg.sendline(command) + sleep(1) + j = egg.expect_exact(["(config-policy-tag)#",pexpect.TIMEOUT],timeout=2) + if j == 0: + logg.info("command sent: {}".format(command)) + if j == 1: + logg.info("timed out on command prompt (config-policy-tag)# for command {}".format(command)) + if i == 1: + logg.info("did not get the (config)# prompt") + + if (args.action == "wireless_tag_policy"): logg.info("send wireless tag policy") egg.sendline("config t") diff --git a/lf_cisco_power.py b/lf_cisco_power.py index 43b03d17..83f43b2d 100755 --- a/lf_cisco_power.py +++ b/lf_cisco_power.py @@ -1496,14 +1496,13 @@ def main(): if args.series == "9800": try: - logg.info("9800 cisco_wifi_ctl.py: wireless_tag_policy") + logg.info("9800 cisco_wifi_ctl.py: no_wlan_wireless_tag_policy") subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, - "--action", "wireless_tag_policy","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) + "--action", "no_wlan_wireless_tag_policy","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) except subprocess.CalledProcessError as process_error: logg.info("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".format(process_error.returncode, process_error.output)) exit_test(workbook) - try: logg.info("9800 cisco_wifi_ctl.py: delete_wlan") subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band,