Fix for file injection is broken on centos computes with Cirros images LP #1587960
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / src / lib / cirros / ds / configdrive
index 9bc201d0ba96db12f8a52b7f393263e380338659..e2385038287912960289dd7fbfa8d06d8be38ab2 100755 (executable)
@@ -4,6 +4,7 @@ VERBOSITY=0
 CONFIG=/etc/cirros-init/configdrive
 NAME="${0##*/}"
 LABEL="config-2"
+LABEL_ALT="CONFIG-2"
 SEED_PRE_D="/var/lib/cloud/seed/configdrive-pre"
 SEED_POST_D="/var/lib/cloud/seed/configdrive"
 
@@ -22,7 +23,8 @@ search_local() {
        local out_d="$1"
        local devlist="" num="" found="" fstree_d=""
        local raw_d="" dev="" rdir="" mdjson="" ud="" found=""
-       find_devs_with "LABEL=$LABEL" ||
+       find_devs_with "LABEL=$LABEL" && [ -n "${_RET}" ] ||
+                find_devs_with "LABEL=$LABEL_ALT" ||
                { error "failed to find devs"; return 1; }
 
        devlist=${_RET}
@@ -61,7 +63,7 @@ search_local() {
                if [ -f "$mdjson" ]; then
                        json2fstree "$fstree_d" "$mdjson" ||
                                fail "json2fstree failed on $mdjson for $dev"
-                       ud="$rdir/openstack/latest/user_data" 
+                       ud="$rdir/openstack/latest/user_data"
                        [ -f "$ud" ] && cp "$ud" "$fstree_d/user-data"
                        found="$dev"
                        mv "$rdir" "$raw_d" ||