summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/python/apex-python-utils.py12
-rw-r--r--lib/python/apex/network_settings.py5
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/python/apex-python-utils.py b/lib/python/apex-python-utils.py
index 6c76cb13..c9dcaa55 100755
--- a/lib/python/apex-python-utils.py
+++ b/lib/python/apex-python-utils.py
@@ -79,14 +79,17 @@ def build_nic_template(args):
interface or br-ex, defines the external network configuration
- address_family: string
4 or 6, respective to ipv4 or ipv6
+ - ovs_dpdk_bridge: string
+ bridge name to use as ovs_dpdk
"""
- dir, template = args.template.rsplit('/', 1)
+ template_dir, template = args.template.rsplit('/', 1)
- env = Environment(loader=FileSystemLoader(dir))
+ env = Environment(loader=FileSystemLoader(template_dir))
template = env.get_template(template)
print(template.render(enabled_networks=args.enabled_networks,
external_net_type=args.ext_net_type,
- external_net_af=args.address_family))
+ external_net_af=args.address_family,
+ ovs_dpdk_bridge=args.ovs_dpdk_bridge))
def parse_args():
@@ -135,6 +138,9 @@ def parse_args():
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')
nic_template.set_defaults(func=build_nic_template)
deploy_settings = subparsers.add_parser('parse-deploy-settings',
diff --git a/lib/python/apex/network_settings.py b/lib/python/apex/network_settings.py
index 1ddf4620..9df8a1de 100644
--- a/lib/python/apex/network_settings.py
+++ b/lib/python/apex/network_settings.py
@@ -223,6 +223,11 @@ class NetworkSettings:
bash_str += "enabled_network_list='{}'\n" \
.format(' '.join(self.enabled_network_list))
bash_str += "ip_addr_family={}\n".format(self.get_ip_addr_family())
+ dns_list = ""
+ for dns_server in self.settings_obj['dns_servers']:
+ dns_list = dns_list + "{} ".format(dns_server)
+ dns_list = dns_list.strip()
+ bash_str += "dns_servers=\'{}\'\n".format(dns_list)
if path:
with open(path, 'w') as file:
file.write(bash_str)