summaryrefslogtreecommitdiffstats
path: root/lib/python
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2016-10-20 13:05:00 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-10-20 13:05:00 +0000
commit117123fec30b033877bb8dfc6257c25c38b1aa72 (patch)
treea31afc223837ce9a492839ef92f7667d7902f6dc /lib/python
parented1361c3ddfb3633850759386daafae42b4c859c (diff)
parente876ec01a7ac7c23a4eff55775dd4bd33398c73a (diff)
Merge "Use ntp parameter from network_settings"
Diffstat (limited to 'lib/python')
-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)