src/api2/types.rs: define SINGLE_LINE_COMMENT_SCHEMA

This commit is contained in:
Dietmar Maurer
2020-01-13 12:02:13 +01:00
parent 167971ed49
commit 454c13edce
5 changed files with 13 additions and 12 deletions

View File

@ -42,7 +42,7 @@ pub fn list_datastores(
},
comment: {
optional: true,
schema: datastore::COMMENT_SCHEMA,
schema: SINGLE_LINE_COMMENT_SCHEMA,
},
path: {
schema: datastore::DIR_NAME_SCHEMA,
@ -63,12 +63,6 @@ pub fn create_datastore(name: String, param: Value) -> Result<(), Error> {
bail!("datastore '{}' already exists.", name);
}
if let Some(ref comment) = datastore.comment {
if comment.find(|c: char| c.is_control()).is_some() {
bail!("comment must not contain control characters!");
}
}
let path: PathBuf = datastore.path.clone().into();
let backup_user = crate::backup::backup_user()?;