diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-09-11 08:35:06 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-09-11 08:35:06 -0400 |
commit | d210dab10b16f5903132b628838c96cb3499b6cd (patch) | |
tree | c99b7ca65d7fadd38701d4f68841395528248f8b /cloudinit/util.py | |
parent | 2a07fcd6444c7deb09063dff6b2f2d6e5385f355 (diff) | |
parent | 89cc478ee56a3f05ee4b810f8c969af9367bd034 (diff) | |
download | vyos-cloud-init-d210dab10b16f5903132b628838c96cb3499b6cd.tar.gz vyos-cloud-init-d210dab10b16f5903132b628838c96cb3499b6cd.zip |
Add OpenNebula datasource.
This reads the context disk from OpenNebula.
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)) |