summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2016-10-19 17:31:30 -0400
committerFeng Pan <fpan@redhat.com>2016-10-19 19:01:33 -0400
commite876ec01a7ac7c23a4eff55775dd4bd33398c73a (patch)
tree2efbd28b93574c7d80c9cc2b3bdd6df922ab662e /lib
parentd39cae2b09362c7df6351e9018a26afc7ce130e9 (diff)
Use ntp parameter from network_settings
Right now we use a ntp_server parameter set in deploy.sh, but since new network_settings file contains ntp information already, we can use those values instead. JIRA: APEX-266 Change-Id: I717af80b967971ea9111002d657972efd94a163a Signed-off-by: Feng Pan <fpan@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/python/apex/common/constants.py1
-rw-r--r--lib/python/apex/network_settings.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/python/apex/common/constants.py b/lib/python/apex/common/constants.py
index db0a9fd1..741bb4f8 100644
--- a/lib/python/apex/common/constants.py
+++ b/lib/python/apex/common/constants.py
@@ -18,6 +18,7 @@ COMPUTE = 'compute'
OPNFV_NETWORK_TYPES = [ADMIN_NETWORK, TENANT_NETWORK, EXTERNAL_NETWORK,
STORAGE_NETWORK, API_NETWORK]
DNS_SERVERS = ["8.8.8.8", "8.8.4.4"]
+NTP_SERVER = ["pool.ntp.org"]
COMPUTE = 'compute'
CONTROLLER = 'controller'
ROLES = [COMPUTE, CONTROLLER]
diff --git a/lib/python/apex/network_settings.py b/lib/python/apex/network_settings.py
index ca40ba93..c9f7d450 100644
--- a/lib/python/apex/network_settings.py
+++ b/lib/python/apex/network_settings.py
@@ -21,6 +21,7 @@ from .common.constants import (
ROLES,
DOMAIN_NAME,
DNS_SERVERS,
+ NTP_SERVER,
ADMIN_NETWORK,
EXTERNAL_NETWORK,
OPNFV_NETWORK_TYPES,
@@ -113,6 +114,7 @@ class NetworkSettings(dict):
if 'dns-domain' not in self:
self['domain_name'] = DOMAIN_NAME
self['dns_servers'] = self.get('dns_nameservers', DNS_SERVERS)
+ self['ntp_servers'] = self.get('ntp', NTP_SERVER)
def _validate_overcloud_nic_order(self, network):
"""
@@ -333,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)