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>
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")