Fixes setting dns server for undercloud 63/15763/2
authorTim Rozet <trozet@redhat.com>
Thu, 16 Jun 2016 18:54:26 +0000 (14:54 -0400)
committerTim Rozet <trozet@redhat.com>
Fri, 17 Jun 2016 15:21:27 +0000 (11:21 -0400)
JIRA: APEX-177

Change-Id: I6ee95a3c525fb58699fb3af795a66639f217214c
Signed-off-by: Tim Rozet <trozet@redhat.com>
ci/deploy.sh
lib/python/apex/network_settings.py

index 05e2fa2..25527da 100755 (executable)
@@ -975,7 +975,11 @@ openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boo
 openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="control" control
 openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="compute" compute
 echo "Configuring nameserver on ctlplane network"
-neutron subnet-update \$(neutron subnet-list | grep -v id | grep -v \\\\-\\\\- | awk {'print \$2'}) --dns-nameserver 8.8.8.8
+dns_server_ext=''
+for dns_server in ${dns_servers}; do
+  dns_server_ext="\${dns_server_ext} --dns-nameserver \${dns_server}"
+done
+neutron subnet-update \$(neutron subnet-list | grep -Ev "id|tenant|external|storage" | grep -v \\\\-\\\\- | awk {'print \$2'}) \${dns_server_ext}
 echo "Executing overcloud deployment, this should run for an extended period without output."
 sleep 60 #wait for Hypervisor stats to check-in to nova
 # save deploy command so it can be used for debugging
index 1ddf462..9df8a1d 100644 (file)
@@ -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)