def find_external_network(self, ext_floating_ip, networks):
"""Find external network based on the network address that matches
external-floating-ipaddr.
If not found, return the management network interface.
Returns: network name, network details
"""
if ext_floating_ip == 'N/A':
return None
for net, net_details in networks.iteritems():
if 'addr' in net_details:
# Check if matching
if (netaddr.IPAddress(ext_floating_ip) in
netaddr.IPSet([net_details['addr']])):
return net, net_details
return 'openstack-mgmt', networks.get('openstack-mgmt', None)
generate_user_config.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录