diff options
author | Ben Howard <ben.howard@canonical.com> | 2013-09-11 14:56:36 -0600 |
---|---|---|
committer | Ben Howard <ben.howard@canonical.com> | 2013-09-11 14:56:36 -0600 |
commit | 23f7b8a39bb197db557bdcf851639ea4111b7786 (patch) | |
tree | 9f1a5501fd1f9c0d4b32b597b09ae19ceaab9ef6 /cloudinit/util.py | |
parent | 1979ea3e3440335632af8e7e58dd34aae52a2b96 (diff) | |
parent | 6b122985da19c08ea50a25226c726f2982680efb (diff) | |
download | vyos-cloud-init-23f7b8a39bb197db557bdcf851639ea4111b7786.tar.gz vyos-cloud-init-23f7b8a39bb197db557bdcf851639ea4111b7786.zip |
Merged in upstream changes with disk partition support
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index 5032cc47..d50d3e18 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -955,6 +955,13 @@ def get_hostname(): return hostname +def gethostbyaddr(ip): + try: + return socket.gethostbyaddr(ip)[0] + except socket.herror: + return None + + def is_resolvable_url(url): """determine if this url is resolvable (existing or ip).""" return (is_resolvable(urlparse.urlparse(url).hostname)) |