From 198e1f74caf0ab07685ca0cd00866038860d4fb4 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 19 Sep 2023 18:43:39 +0200 Subject: [PATCH] Fix "none" datasource to create output directory. When src/sbin/cirros-ds calls a datasource it passes a directory that does not yet exist. The datasource (/lib/cirros/ds/nocloud) is expected to create it. The none datasource was not doing that. As a result, you'd see: /lib/cirros/ds/none: line 23: can't create .../none/data/instance-id: nonexistent line 24: can't create .../none/result: nonexistent directory --- src/lib/cirros/ds/none | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/cirros/ds/none b/src/lib/cirros/ds/none index 1d6c579..19d6170 100755 --- a/src/lib/cirros/ds/none +++ b/src/lib/cirros/ds/none @@ -20,6 +20,8 @@ EOF search_local() { local out_d="$1" local data_d="${out_d}/data" + [ -d "$out_d" ] || mkdir -p "$out_d" || + { error "failed to create output dir"; return 1; } echo "i-dsnone" > "${data_d}/instance-id" echo 0 > "$out_d/result" }