fix(xo-server/vif.set): don't change locking mode automatically (#5357)

See xoa-support#2929
This commit is contained in:
Rajaa.BARHTAOUI 2020-11-10 15:15:54 +01:00 committed by GitHub
parent a691e033eb
commit 7fcfc306f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 35 deletions

View File

@ -15,6 +15,7 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Remotes/NFS] Only mount with `vers=3` when no other options [#4940](https://github.com/vatesfr/xen-orchestra/issues/4940) (PR [#5354](https://github.com/vatesfr/xen-orchestra/pull/5354))
- [VM/network] Don't change VIF's locking mode automatically (PR [#5357](https://github.com/vatesfr/xen-orchestra/pull/5357))
### Packages to release

View File

@ -119,7 +119,7 @@ export async function set({
mac,
currently_attached: attached,
ipv4_allowed: newIpAddresses,
locking_mode: lockingMode,
locking_mode: lockingMode ?? vif.lockingMode,
qos_algorithm_type: rateLimit != null ? 'ratelimit' : undefined,
qos_algorithm_params:
rateLimit != null ? { kbps: String(rateLimit) } : undefined,

View File

@ -1,5 +1,3 @@
import { isEmpty } from '../../utils'
import { makeEditObject } from '../utils'
export default {
@ -26,38 +24,8 @@ export default {
await this._disconnectVif(this.getObject(vifId))
},
editVif: makeEditObject({
ipv4Allowed: {
get: true,
set: [
'ipv4Allowed',
function (value, vif) {
const lockingMode =
isEmpty(value) && isEmpty(vif.ipv6_allowed)
? 'network_default'
: 'locked'
if (lockingMode !== vif.locking_mode) {
return vif.set_locking_mode(lockingMode)
}
},
],
},
ipv6Allowed: {
get: true,
set: [
'ipv6Allowed',
function (value, vif) {
const lockingMode =
isEmpty(value) && isEmpty(vif.ipv4_allowed)
? 'network_default'
: 'locked'
if (lockingMode !== vif.locking_mode) {
return vif.set_locking_mode(lockingMode)
}
},
],
},
ipv4Allowed: true,
ipv6Allowed: true,
lockingMode: {
set: (value, vif) => vif.set_locking_mode(value),
},