()
| 56 | |
| 57 | |
| 58 | def get_ip(): |
| 59 | global ip |
| 60 | if ip: |
| 61 | return ip |
| 62 | sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |
| 63 | try: |
| 64 | sock.connect(('8.8.8.8', 80)) |
| 65 | ip = sock.getsockname()[0] |
| 66 | logger.debug('Current IP Address: {}'.format(ip)) |
| 67 | finally: |
| 68 | sock.close() |
| 69 | return ip |
| 70 | |
| 71 | |
| 72 | def get_pid(): |
no test coverage detected