How to use the ciscoconfparse.ccp_util.IPv6Obj function in ciscoconfparse

To help you get started, we’ve selected a few ciscoconfparse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mpenning / ciscoconfparse / tests / test_Ccp_Util.py View on Github external
def testIPv6Obj_recursive():
    """IPv6Obj() should be able to parse itself"""
    obj = IPv6Obj(IPv6Obj('fe80:a:b:c:d:e::1/64'))
    assert str(obj.ip_object)=='fe80:a:b:c:d:e:0:1'
    assert obj.prefixlen==64
github mpenning / ciscoconfparse / ciscoconfparse / models_nxos.py View on Github external
def network_object(self):
        try:
            if self._address_family == 'ip':
                return IPv4Obj(
                    '%s/%s' % (self.network, self.masklen), strict=False)
            elif self._address_family == 'ipv6':
                return IPv6Obj('%s/%s' % (self.network, self.masklen))
        except:
            return None
github mpenning / ciscoconfparse / ciscoconfparse / models_cisco.py View on Github external
def network_object(self):
        try:
            if self._address_family == 'ip':
                return IPv4Obj(
                    '%s/%s' % (self.network, self.netmask), strict=False)
            elif self._address_family == 'ipv6':
                return IPv6Obj('%s/%s' % (self.network, self.masklen))
        except:
            return None