~openstack-charmers-next/charms/precise/lxd/trunk

« back to all changes in this revision

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

  • Committer: Chuck Short
  • Date: 2016-06-27 13:49:33 UTC
  • Revision ID: chuck.short@canonical.com-20160627134933-c19tnq94oytk9a41
Switch to using charm-store for amulet tests

All OpenStack charms are now directly published to the charm store
on landing; switch Amulet helper to resolve charms using the
charm store rather than bzr branches, removing the lag between
charm changes landing and being available for other charms to
use for testing.

This is also important for new layered charms where the charm must
be build and published prior to being consumable.

Change-Id: I1bcb20ab061fa639cc1116d2fe0bbf4c5a4464bc
Signed-off-by: Chuck Short <chuck.short@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
405
405
    Returns True if address is a valid IP address.
406
406
    """
407
407
    try:
408
 
        # Test to see if already an IPv4 address
409
 
        socket.inet_aton(address)
 
408
        # Test to see if already an IPv4/IPv6 address
 
409
        address = netaddr.IPAddress(address)
410
410
        return True
411
 
    except socket.error:
 
411
    except netaddr.AddrFormatError:
412
412
        return False
413
413
 
414
414