api: directory: use relative path when creating removable datastore

In an earlier version of this series the datastore path was absolute
for removable datastores. This is simply a leftover that was missed
when changing that to relative paths.

Reported-by: Markus Frank <m.frank@proxmox.com>
Fixes: 94a068e31 ("api: node: allow creation of removable datastore through directory endpoint")
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
Hannes Laimer 2024-11-26 17:51:26 +01:00 committed by Thomas Lamprecht
parent c5c7fd3482
commit 363e32a805

View File

@ -237,7 +237,7 @@ pub fn create_datastore_disk(
let lock = pbs_config::datastore::lock_config()?; let lock = pbs_config::datastore::lock_config()?;
let datastore: DataStoreConfig = if removable_datastore { let datastore: DataStoreConfig = if removable_datastore {
serde_json::from_value( serde_json::from_value(
json!({ "name": name, "path": format!("/{name}"), "backing-device": uuid }), json!({ "name": name, "path": name, "backing-device": uuid }),
)? )?
} else { } else {
serde_json::from_value(json!({ "name": name, "path": mount_point }))? serde_json::from_value(json!({ "name": name, "path": mount_point }))?