Merge "Revert "Add ability to configure allowed vlan ranges in deploy configuration""
[apex.git] / lib / python / apex / network_settings.py
index 1179808..c9f7d45 100644 (file)
@@ -21,6 +21,7 @@ from .common.constants import (
     ROLES,
     DOMAIN_NAME,
     DNS_SERVERS,
+    NTP_SERVER,
     ADMIN_NETWORK,
     EXTERNAL_NETWORK,
     OPNFV_NETWORK_TYPES,
@@ -39,7 +40,7 @@ class NetworkSettings(dict):
     for deploy.sh consumption. This object will later be used directly as
     deployment script move to python.
     """
-    def __init__(self, filename, network_isolation):
+    def __init__(self, filename):
         init_dict = {}
         if type(filename) is str:
             with open(filename, 'r') as network_settings_file:
@@ -63,7 +64,6 @@ class NetworkSettings(dict):
             # merge the apex specific config into the first class settings
             merge(self, copy(self['apex']))
 
-        self.network_isolation = network_isolation
         self.enabled_network_list = []
         self.nics = {COMPUTE: {}, CONTROLLER: {}}
         self.nics_specified = {COMPUTE: False, CONTROLLER: False}
@@ -113,7 +113,8 @@ class NetworkSettings(dict):
 
         if 'dns-domain' not in self:
             self['domain_name'] = DOMAIN_NAME
-        self['dns_servers'] = self.get('dns_servers', DNS_SERVERS)
+        self['dns_servers'] = self.get('dns_nameservers', DNS_SERVERS)
+        self['ntp_servers'] = self.get('ntp', NTP_SERVER)
 
     def _validate_overcloud_nic_order(self, network):
         """
@@ -334,6 +335,7 @@ class NetworkSettings(dict):
         bash_str += flatten('ip_addr_family', self.get_ip_addr_family())
         bash_str += flatten('dns_servers', self['dns_servers'], ' ')
         bash_str += flatten('domain_name', self['dns-domain'], ' ')
+        bash_str += flatten('ntp_server', self['ntp_servers'][0], ' ')
         if path:
             with open(path, 'w') as file:
                 file.write(bash_str)