Pull default USER_DATA_ID from cloud.cfg 75/11775/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 13 Jul 2018 15:11:15 +0000 (11:11 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 13 Jul 2018 15:11:24 +0000 (11:11 -0400)
Sets the default USER_DATA_ID for minion templates to be
what is defined in cloud.cfg. If cloud.cfg does not define
one then default to "jenkins-init-script".

RELENG-1069
Change-Id: I135c9a6c1d0ee11e627a66d1cc87e60eb7db1b20
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
shell/jenkins-configure-clouds.sh

index 0b30c59..47023f7 100644 (file)
@@ -166,7 +166,9 @@ get_minion_options() {
     volume_size=$(get_cfg "$cfg_file" VOLUME_SIZE "")
     hardware_id=$(get_cfg "$cfg_file" HARDWARE_ID "")
     network_id=$(get_cfg "$cfg_file" NETWORK_ID "")
-    user_data_id=$(get_cfg "$cfg_file" USER_DATA_ID "jenkins-init-script")
+
+    udi_default="$(get_cfg "$(dirname $cfg_file)/cloud.cfg" USER_DATA_ID "jenkins-init-script")"
+    user_data_id=$(get_cfg "$cfg_file" USER_DATA_ID "$udi_default")
 
     # Handle Sandbox systems that might have a different cap.
     instance_cap=$(get_cfg "$cfg_file" INSTANCE_CAP "null")