X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FCapwapLibrary.py;h=0a1e63ee7dacaeac27046f3626427700860469bc;hb=209170908d6fced1e88cb5edcf8259abca9702b0;hp=89a123a9e72c505ace4f4a4b0b73804f58c9d05b;hpb=59e81c38620fa1b61e15771191e35771450b9499;p=integration%2Ftest.git diff --git a/csit/libraries/CapwapLibrary.py b/csit/libraries/CapwapLibrary.py index 89a123a9e7..0a1e63ee7d 100644 --- a/csit/libraries/CapwapLibrary.py +++ b/csit/libraries/CapwapLibrary.py @@ -14,13 +14,35 @@ class CapwapLibrary(object): def __init__(self): self.builtin = BuiltIn() - def send_discover(self, ac_ip, wtp_ip='', ip='ip', port=5246): + def send_discover(self, ac_ip, wtp_ip="", ip="ip", port=5246): """Send Discover CAPWAP Packet from a WTP.""" - data = ''.join(chr(x) for x in [0x00, 0x20, 0x01, 0x02, 0x03, 0x04, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]) - self.builtin.log('Sending Discover Packet to: %s' % ac_ip, 'DEBUG') + data = "".join( + chr(x) + for x in [ + 0x00, + 0x20, + 0x01, + 0x02, + 0x03, + 0x04, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + ] + ) + self.builtin.log("Sending Discover Packet to: %s" % ac_ip, "DEBUG") session = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) session.sendto(data, (ac_ip, port)) - self.builtin.log('Packet Sent', 'DEBUG') + self.builtin.log("Packet Sent", "DEBUG") def get_hostip(self): """Get Host IP Address.""" @@ -29,7 +51,7 @@ class CapwapLibrary(object): def get_simulated_wtpip(self, controller): """Get the Simulated WTP ip based on the controller.""" - if controller == '127.0.0.1': + if controller == "127.0.0.1": exp_ip = controller else: exp_ip = self.get_hostip()