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 ### 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 ### Released packages
- xo-server v5.26.0 - xo-server v5.26.0

View File

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

View File

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