From e876ec01a7ac7c23a4eff55775dd4bd33398c73a Mon Sep 17 00:00:00 2001 From: Feng Pan Date: Wed, 19 Oct 2016 17:31:30 -0400 Subject: 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 --- lib/python/apex/common/constants.py | 1 + lib/python/apex/network_settings.py | 3 +++ 2 files changed, 4 insertions(+) (limited to 'lib/python/apex') 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) -- cgit 1.2.3-korg