Retrieve hostname for the given IP.
(ip)
| 64 | |
| 65 | |
| 66 | def get_hostname(ip): |
| 67 | """Retrieve hostname for the given IP.""" |
| 68 | try: |
| 69 | return socket.gethostbyaddr(ip)[0] |
| 70 | except socket.herror: |
| 71 | return None |
| 72 | |
| 73 | def get_my_ip(): |
| 74 | """Retrieve the external IP address.""" |
no outgoing calls
no test coverage detected