resync charmhelper

This commit is contained in:
yolanda.robla@canonical.com 2014-03-12 13:05:16 +01:00
parent ef0038c70f
commit f41649ff0f
2 changed files with 13 additions and 13 deletions

View File

@ -420,19 +420,19 @@ def get_hostname(address, fqdn=True):
Resolves hostname for given IP, or returns the input
if it is already a hostname.
"""
if not is_ip(address):
return address
if is_ip(address):
try:
import dns.reversename
except ImportError:
apt_install('python-dnspython')
import dns.reversename
try:
import dns.reversename
except ImportError:
apt_install('python-dnspython')
import dns.reversename
rev = dns.reversename.from_address(address)
result = ns_query(rev)
if not result:
return None
rev = dns.reversename.from_address(address)
result = ns_query(rev)
if not result:
return None
else:
result = address
if fqdn:
# strip trailing .

View File

@ -1 +1 @@
131
132