mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 04:07:52 +00:00
separated policy from wan creation
This commit is contained in:
@@ -97,7 +97,8 @@ def main():
|
|||||||
choices=["config", "country", "ap_country", "enable", "disable", "summary", "advanced",
|
choices=["config", "country", "ap_country", "enable", "disable", "summary", "advanced",
|
||||||
"cmd", "txPower", "bandwidth", "manual", "auto", "open_wlan","no_open_wlan","show_wlan_summary",
|
"cmd", "txPower", "bandwidth", "manual", "auto", "open_wlan","no_open_wlan","show_wlan_summary",
|
||||||
"ap_channel", "channel", "show", "wlan", "enable_wlan", "delete_wlan", "wlan_qos",
|
"ap_channel", "channel", "show", "wlan", "enable_wlan", "delete_wlan", "wlan_qos",
|
||||||
"disable_network_5ghz","disable_network_24ghz","enable_network_5ghz","enable_network_24ghz" ])
|
"disable_network_5ghz","disable_network_24ghz","enable_network_5ghz","enable_network_24ghz",
|
||||||
|
"wlan_enable", "wlan_disable","wireless_tag_policy"])
|
||||||
parser.add_argument("--value", type=str, help="set value")
|
parser.add_argument("--value", type=str, help="set value")
|
||||||
|
|
||||||
args = None
|
args = None
|
||||||
@@ -498,8 +499,6 @@ def main():
|
|||||||
logg.info("waiting for prompt: %s"%(CCPROMPT))
|
logg.info("waiting for prompt: %s"%(CCPROMPT))
|
||||||
egg.expect(">", timeout=3)
|
egg.expect(">", timeout=3)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
logg.info("Ap[%s] Action[%s] Value[%s] "%(args.ap, args.action, args.value))
|
logg.info("Ap[%s] Action[%s] Value[%s] "%(args.ap, args.action, args.value))
|
||||||
print("Ap[%s] Action[%s] Value[%s]"%(args.ap, args.action, args.value))
|
print("Ap[%s] Action[%s] Value[%s]"%(args.ap, args.action, args.value))
|
||||||
|
|
||||||
@@ -642,6 +641,34 @@ def main():
|
|||||||
else:
|
else:
|
||||||
command = "show ap channel %s"%(args.ap)
|
command = "show ap channel %s"%(args.ap)
|
||||||
|
|
||||||
|
if (args.action == ["enable_wlan","disable_wlan"]):
|
||||||
|
egg.sendline("config t")
|
||||||
|
i = egg.expect_exact(["(config)#",pexpect.TIMEOUT],timeout=2)
|
||||||
|
if i == 0:
|
||||||
|
print("elevated to (config)#")
|
||||||
|
egg.sendline("wlan open-wlan")
|
||||||
|
j = egg.expect_exact(["(config-wlan)#",pexpect.TIMEOUT],timeout=2)
|
||||||
|
if j == 0:
|
||||||
|
if (args.action == "enable_wlan"):
|
||||||
|
command = "no shutdown"
|
||||||
|
else:
|
||||||
|
commane = "shutdown"
|
||||||
|
egg.sendline(command)
|
||||||
|
sleep(0.1)
|
||||||
|
k = egg.expect_exact(["(config-wlan)#",pexpect.TIMEOUT],timeout=2)
|
||||||
|
if k == 0:
|
||||||
|
print("command sent: {}".format(command))
|
||||||
|
if k == 1:
|
||||||
|
if command == "end":
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
print("command time out: {}".format(command))
|
||||||
|
if j == 1:
|
||||||
|
print("did not get the (config-wlan)# prompt")
|
||||||
|
if i == 0:
|
||||||
|
print("did not get the (config)# prompt")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (args.action == "open_wlan"):
|
if (args.action == "open_wlan"):
|
||||||
print("Configure a open wlan 9800 series")
|
print("Configure a open wlan 9800 series")
|
||||||
@@ -669,6 +696,7 @@ def main():
|
|||||||
if i == 0:
|
if i == 0:
|
||||||
print("did not get the (config)# prompt")
|
print("did not get the (config)# prompt")
|
||||||
|
|
||||||
|
if (args.action == "wireless_tag_policy"):
|
||||||
print("send wireless tag policy")
|
print("send wireless tag policy")
|
||||||
egg.sendline("config t")
|
egg.sendline("config t")
|
||||||
sleep(0.1)
|
sleep(0.1)
|
||||||
|
|||||||
@@ -489,6 +489,13 @@ def main():
|
|||||||
subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band,
|
subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band,
|
||||||
"--action", "open_wlan","--series",args.series])
|
"--action", "open_wlan","--series",args.series])
|
||||||
|
|
||||||
|
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])
|
||||||
|
|
||||||
|
subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band,
|
||||||
|
"--action", "wlan_enable","--series",args.series])
|
||||||
|
|
||||||
|
|
||||||
# enable transmission for the entier 802.11z network
|
# enable transmission for the entier 802.11z network
|
||||||
if args.series == "9800":
|
if args.series == "9800":
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user