def _parse_subnet(self, subnet_dict):
        """Return the subnet, start, end, gateway of a subnet. """
        if not subnet_dict:
            return
        alloc_pool = subnet_dict.get('allocation_pools')
        cidr = subnet_dict.get('cidr')
        subnet = cidr.split('/')[0]
        start = alloc_pool[0].get('start')
        end = alloc_pool[0].get('end')
        gateway = subnet_dict.get('gateway_ip')
        sec_gateway = subnet_dict.get('secondary_gw')
        return {'subnet': subnet, 'start': start, 'end': end,
                'gateway': gateway, 'sec_gateway': sec_gateway}
def _parse_subnet ( self , subnet_dict ) : if not subnet_dict : return alloc_pool = subnet_dict . get ( 'allocation_pools' ) cidr = subnet_dict . get ( 'cidr' ) subnet = cidr . split ( '/' ) [ 0 ] start = alloc_pool [ 0 ] . get ( 'start' ) end = alloc_pool [ 0 ] . get ( 'end' ) gateway = subnet_dict . get ( 'gateway_ip' ) sec_gateway = subnet_dict . get ( 'secondary_gw' ) return { 'subnet' : subnet , 'start' : start , 'end' : end , 'gateway' : gateway , 'sec_gateway' : sec_gateway }
Return the subnet, start, end, gateway of a subnet.