|
@@ -549,6 +549,12 @@ func HandleStoragePoolRemove(w http.ResponseWriter, r *http.Request) {
|
|
func buildOptionFromRequestForm(payload string) (fs.FileSystemOption, error) {
|
|
func buildOptionFromRequestForm(payload string) (fs.FileSystemOption, error) {
|
|
newFsOption := fs.FileSystemOption{}
|
|
newFsOption := fs.FileSystemOption{}
|
|
err := json.Unmarshal([]byte(payload), &newFsOption)
|
|
err := json.Unmarshal([]byte(payload), &newFsOption)
|
|
|
|
+
|
|
|
|
+ //Do data cleaning
|
|
|
|
+ newFsOption.Name = strings.TrimSpace(newFsOption.Name)
|
|
|
|
+ newFsOption.Uuid = strings.TrimSpace(newFsOption.Uuid)
|
|
|
|
+ newFsOption.Path = strings.TrimSpace(newFsOption.Path)
|
|
|
|
+
|
|
if err != nil {
|
|
if err != nil {
|
|
return fs.FileSystemOption{}, err
|
|
return fs.FileSystemOption{}, err
|
|
}
|
|
}
|