~ivoks/charms/trusty/contrail-analytics/host-private-address

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/network/ip.py

  • Committer: Robert Ayres
  • Date: 2015-08-28 11:03:51 UTC
  • Revision ID: robert.ayres@canonical.com-20150828110351-g20rec150sofg9ag
Sync charm helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
435
435
 
436
436
        rev = dns.reversename.from_address(address)
437
437
        result = ns_query(rev)
 
438
 
438
439
        if not result:
439
 
            return None
 
440
            try:
 
441
                result = socket.gethostbyaddr(address)[0]
 
442
            except:
 
443
                return None
440
444
    else:
441
445
        result = address
442
446