summaryrefslogtreecommitdiffstats
path: root/lib/python
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2016-08-18 17:03:02 -0400
committerDan Radez <dradez@redhat.com>2016-08-22 11:19:54 -0400
commitb55e605853d91e6c7078101238dd52c3904e83eb (patch)
tree09c4c49c08b2557aabcb889fa0b43b8235771eeb /lib/python
parent7de33840b2cb0d9ccf29b28fa477f5bb57b2508c (diff)
removing enabled_network_list as an argument to network env
NetworkSettings Object is being rendered and passed to net env object already. We can get the enabled network list from the network settings object instead of passing it in as an arg. Basically just removing duplicate arguments to the network env object. Change-Id: I828c60878a0432cae2b37c08ae1896dce49071d0 Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'lib/python')
-rwxr-xr-xlib/python/apex_python_utils.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/python/apex_python_utils.py b/lib/python/apex_python_utils.py
index 829b3a0f..b6aaafaa 100755
--- a/lib/python/apex_python_utils.py
+++ b/lib/python/apex_python_utils.py
@@ -95,19 +95,19 @@ def build_nic_template(args):
"""
template_dir, template = args.template.rsplit('/', 1)
- network_settings = NetworkSettings(args.net_settings_file,
- args.network_isolation)
+ netsets = NetworkSettings(args.net_settings_file,
+ args.network_isolation)
env = Environment(loader=FileSystemLoader(template_dir))
template = env.get_template(template)
# gather vlan values into a dict
- net_list = copy(args.enabled_networks).split(' ')
+ net_list = copy(netsets.enabled_network_list)
net_list.remove(ADMIN_NETWORK)
- vlans_vals = map(lambda x: network_settings[x]['vlan'], net_list)
+ vlans_vals = map(lambda x: netsets[x]['vlan'], net_list)
vlans = dict(zip(net_list, vlans_vals))
- nics = network_settings.nics
+ nics = netsets.nics
- print(template.render(enabled_networks=args.enabled_networks,
+ print(template.render(enabled_networks=netsets.enabled_network_list,
role=args.role,
vlans=vlans,
external_net_type=args.ext_net_type,
@@ -174,9 +174,6 @@ def get_parser():
nic_template.add_argument('--flat', action='store_false',
default=True, dest='network_isolation',
help='disable network isolation')
- nic_template.add_argument('-n', '--enabled-networks', required=True,
- dest='enabled_networks',
- help='enabled network list')
nic_template.add_argument('-e', '--ext-net-type', default='interface',
dest='ext_net_type',
choices=['interface', 'br-ex'],