resync charmhelper
This commit is contained in:
parent
ef0038c70f
commit
f41649ff0f
@ -420,9 +420,7 @@ 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:
|
||||
@ -433,6 +431,8 @@ def get_hostname(address, fqdn=True):
|
||||
result = ns_query(rev)
|
||||
if not result:
|
||||
return None
|
||||
else:
|
||||
result = address
|
||||
|
||||
if fqdn:
|
||||
# strip trailing .
|
||||
|
Loading…
Reference in New Issue
Block a user