[openstack-dev] [Neutron] netaddr and abbreviated CIDR format

Sean M. Collins sean at coreitpro.com
Fri Aug 21 22:07:13 UTC 2015


Here's what the implicit_prefix arg for the IPNetwork constructor does.

    Python 2.7.6 (default, Sep  9 2014, 15:04:36)
    [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import netaddr
    >>> a = netaddr.IPNetwork("1", implicit_prefix=True)
    >>> a
    IPNetwork('1.0.0.0/8')
    >>> a = netaddr.IPNetwork("1", implicit_prefix=False)
    >>> a
    IPNetwork('1.0.0.0/32')
    >>>

-- 
Sean M. Collins



More information about the OpenStack-dev mailing list