summaryrefslogtreecommitdiffstats
path: root/lib/python/apex_python_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/apex_python_utils.py')
-rwxr-xr-xlib/python/apex_python_utils.py33
1 files changed, 5 insertions, 28 deletions
diff --git a/lib/python/apex_python_utils.py b/lib/python/apex_python_utils.py
index 9d6110bb..b0ebb270 100755
--- a/lib/python/apex_python_utils.py
+++ b/lib/python/apex_python_utils.py
@@ -14,8 +14,6 @@ import logging
import os
import yaml
-from copy import copy
-
from jinja2 import Environment
from jinja2 import FileSystemLoader
@@ -35,11 +33,8 @@ def parse_net_settings(args):
Args:
- file: string
file to network_settings.yaml file
- - network_isolation: bool
- enable or disable network_isolation
"""
- settings = NetworkSettings(args.net_settings_file,
- args.network_isolation)
+ settings = NetworkSettings(args.net_settings_file)
net_env = NetworkEnvironment(settings, args.net_env_file,
args.compute_pre_config,
args.controller_pre_config)
@@ -108,25 +103,15 @@ def build_nic_template(args):
"""
template_dir, template = args.template.rsplit('/', 1)
- netsets = NetworkSettings(args.net_settings_file,
- args.network_isolation)
+ netsets = NetworkSettings(args.net_settings_file)
env = Environment(loader=FileSystemLoader(template_dir), autoescape=True)
template = env.get_template(template)
- # gather vlan values into a dict
- net_list = copy(netsets.enabled_network_list)
- net_list.remove(ADMIN_NETWORK)
- vlans_vals = map(lambda x: netsets[x]['vlan'], net_list)
- vlans = dict(zip(net_list, vlans_vals))
- nics = netsets.nics
-
- print(template.render(enabled_networks=netsets.enabled_network_list,
+ print(template.render(nets=netsets['networks'],
role=args.role,
- vlans=vlans,
+ external_net_af=netsets.get_ip_addr_family(),
external_net_type=args.ext_net_type,
- external_net_af=args.address_family,
- ovs_dpdk_bridge=args.ovs_dpdk_bridge,
- nics=nics))
+ ovs_dpdk_bridge=args.ovs_dpdk_bridge))
def get_parser():
@@ -143,9 +128,6 @@ def get_parser():
default='network-settings.yaml',
dest='net_settings_file',
help='path to network settings file')
- net_settings.add_argument('--flat', action='store_false',
- default=True, dest='network_isolation',
- help='disable network isolation')
net_settings.add_argument('-e', '--net-env-file',
default="network-environment.yaml",
dest='net_env_file',
@@ -189,15 +171,10 @@ def get_parser():
default='network-settings.yaml',
dest='net_settings_file',
help='path to network settings file')
- nic_template.add_argument('--flat', action='store_false',
- default=True, dest='network_isolation',
- help='disable network isolation')
nic_template.add_argument('-e', '--ext-net-type', default='interface',
dest='ext_net_type',
choices=['interface', 'br-ex'],
help='External network type')
- nic_template.add_argument('-af', '--address-family', type=int, default=4,
- dest='address_family', help='IP address family')
nic_template.add_argument('-d', '--ovs-dpdk-bridge',
default=None, dest='ovs_dpdk_bridge',
help='OVS DPDK Bridge Name')