Skip to content

Commit

Permalink
Fix "none" datasource to create output directory.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
smoser committed Sep 19, 2023
1 parent 3620782 commit 198e1f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/cirros/ds/none
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 198e1f7

Please sign in to comment.