diff --git a/hooks/utils.py b/hooks/utils.py index b8e16623..dc4a9379 100644 --- a/hooks/utils.py +++ b/hooks/utils.py @@ -49,8 +49,10 @@ def enable_pocket(pocket): sources.write(line) -def get_host_ip(hostname=unit_get('private-address')): +def get_host_ip(hostname=None): try: + if not hostname: + hostname=unit_get('private-address') # Test to see if already an IPv4 address socket.inet_aton(hostname) return hostname