mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 12:18:00 +00:00
lf_cleanup.py : pep8 cleanup
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
@@ -177,19 +177,20 @@ class lf_clean(Realm):
|
|||||||
self.sta_done = True
|
self.sta_done = True
|
||||||
return still_looking_sta
|
return still_looking_sta
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
1: delete cx
|
1: delete cx
|
||||||
2: delete endp
|
2: delete endp
|
||||||
3: delete sta
|
3: delete sta
|
||||||
when deleting sta first, you will end up with phantom CX
|
when deleting sta first, you will end up with phantom CX
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
if self.clean_cxs:
|
if self.clean_cxs:
|
||||||
# also clean the endp when cleaning cxs
|
# also clean the endp when cleaning cxs
|
||||||
still_looking_cxs = self.cxs_clean()
|
still_looking_cxs = self.cxs_clean()
|
||||||
still_looking_endp = self.endp_clean()
|
still_looking_endp = self.endp_clean()
|
||||||
print("clean_cxs: still_looking_cxs {looking_cxs} still_looking_endp {looking_endp}".format(looking_cxs=still_looking_cxs,looking_endp=still_looking_endp))
|
print("clean_cxs: still_looking_cxs {looking_cxs} still_looking_endp {looking_endp}".format(
|
||||||
|
looking_cxs=still_looking_cxs, looking_endp=still_looking_endp))
|
||||||
if self.clean_endp and not self.clean_cxs:
|
if self.clean_endp and not self.clean_cxs:
|
||||||
still_looking_endp = self.endp_clean()
|
still_looking_endp = self.endp_clean()
|
||||||
print("clean_endp: still_looking_endp {looking_endp}".format(looking_endp=still_looking_endp))
|
print("clean_endp: still_looking_endp {looking_endp}".format(looking_endp=still_looking_endp))
|
||||||
@@ -198,6 +199,7 @@ class lf_clean(Realm):
|
|||||||
still_looking_sta = self.sta_clean()
|
still_looking_sta = self.sta_clean()
|
||||||
print("clean_sta: still_looking_sta {looking_sta}".format(looking_sta=still_looking_sta))
|
print("clean_sta: still_looking_sta {looking_sta}".format(looking_sta=still_looking_sta))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
@@ -239,8 +241,8 @@ python3 ./lf_clean.py --mgr MGR
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.cxs or args.endp or args.sta:
|
if args.cxs or args.endp or args.sta:
|
||||||
clean = lf_clean(host=args.mgr,clean_cxs=args.cxs,clean_endp=args.endp,clean_sta=args.sta )
|
clean = lf_clean(host=args.mgr, clean_cxs=args.cxs, clean_endp=args.endp, clean_sta=args.sta)
|
||||||
print("cleaning cxs: {cxs} endpoints: {endp} stations: {sta} start".format(cxs=args.cxs,endp=args.endp,sta=args.sta))
|
print("cleaning cxs: {cxs} endpoints: {endp} stations: {sta} start".format(cxs=args.cxs, endp=args.endp, sta=args.sta))
|
||||||
if args.cxs:
|
if args.cxs:
|
||||||
print("cleaning cxs will also clean endp")
|
print("cleaning cxs will also clean endp")
|
||||||
clean.cxs_clean()
|
clean.cxs_clean()
|
||||||
@@ -255,5 +257,6 @@ python3 ./lf_clean.py --mgr MGR
|
|||||||
else:
|
else:
|
||||||
print("please add option of --cxs ,--endp, or --sta to clean")
|
print("please add option of --cxs ,--endp, or --sta to clean")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user