fix(xo-server,xo-web): NFS remotes mount options (#3363)

Fixes #3361
This commit is contained in:
Pierre Donias 2018-08-27 10:39:35 +02:00 committed by Julien Fontanet
parent 0034f0a1d3
commit ce35bbaeb4
3 changed files with 11 additions and 6 deletions

View File

@ -6,6 +6,8 @@
### Bug fixes
- [Remotes] Fix "undefined" mount option issue [#3361](https://github.com/vatesfr/xen-orchestra/issues/3361) (PR [#3363](https://github.com/vatesfr/xen-orchestra/pull/3363))
### Released packages
- xo-server v5.26.0

View File

@ -89,13 +89,16 @@ export default class {
}
async createRemote ({ name, url, options }) {
const remote = await this._remotes.add({
const params = {
name,
url,
options,
enabled: false,
error: '',
})
}
if (options !== undefined) {
params.options = options
}
const remote = await this._remotes.add(params)
return /* await */ this.updateRemote(remote.get('id'), { enabled: true })
}

View File

@ -46,7 +46,7 @@ export default [
domain = remote.domain,
host = remote.host,
name,
options = remote.options,
options = remote.options || '',
password = remote.password,
path = remote.path,
port = remote.port,
@ -64,7 +64,7 @@ export default [
type,
username,
}),
options,
options: options !== '' ? options : null,
}).then(reset)
},
createRemote: ({ reset }) => async (state, { remotes }) => {
@ -107,7 +107,7 @@ export default [
}
const url = format(urlParams)
return createRemote(name, url, options)
return createRemote(name, url, options !== '' ? options : undefined)
.then(reset)
.catch(err => error('Create Remote', err.message || String(err)))
},