api/datastore: do not allow updating path for now

It's a bit dangerous as it points to all the saved backups, so they
would be seemingly lost after updating the path.
Follow our logic from other products, e.g. in PVE we do not allow to
update the backing path/location of a storage either for similar
reasons.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-01-15 16:11:44 +01:00
parent 1685c2e341
commit 44b65b4ec7

View File

@ -108,10 +108,6 @@ pub fn read_datastore(name: String) -> Result<Value, Error> {
optional: true,
schema: SINGLE_LINE_COMMENT_SCHEMA,
},
path: {
optional: true,
schema: datastore::DIR_NAME_SCHEMA,
},
digest: {
optional: true,
schema: PROXMOX_CONFIG_DIGEST_SCHEMA,
@ -147,7 +143,6 @@ pub fn update_datastore(
data.comment = Some(comment);
}
}
if let Some(path) = path { data.path = path; }
config.set_data(&name, "datastore", &data)?;