summaryrefslogtreecommitdiffstats
path: root/lib/python/apex_python_utils.py
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2016-07-19 13:17:17 -0400
committerDan Radez <dradez@redhat.com>2016-09-22 15:03:58 -0400
commit38de9ff18e44e5c3c1393c060481fbbb27543704 (patch)
tree0e1b93aba5d03b08ed3a44f5c7e96e6b66788656 /lib/python/apex_python_utils.py
parent30a2e131972b7b4dbccb702f0fc329ca6b2dd6a6 (diff)
migrating to proposed common network settings file
- proposed in genesis https://wiki.opnfv.org/display/genesis/Common+Network+Settings - This patch updates the network_settings files in the config/network dir and updates the associated bash, python and python tests relative to the new yaml structure and nomenclature used in the proposed settings file JIRA: APEX-262 Change-Id: Ib0dc9d0f21465b38f2a53cff20f71fb9230bfc48 Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'lib/python/apex_python_utils.py')
-rwxr-xr-xlib/python/apex_python_utils.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/python/apex_python_utils.py b/lib/python/apex_python_utils.py
index 9d6110bb..b67028ac 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
@@ -113,20 +111,11 @@ def build_nic_template(args):
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():
@@ -196,8 +185,6 @@ def get_parser():
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')