From 29b941868dda6447a33656d673b6f6d44c6e9268 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Thu, 7 Feb 2019 16:44:42 +0100 Subject: [PATCH] feat(xen-api): work-around empty VBD#VDI XenServer issue (#3950) --- CHANGELOG.unreleased.md | 2 ++ packages/xen-api/src/index.js | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index c733e3fe6..5e1bd5134 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -3,6 +3,7 @@ ### Enhancements - [Home] Set description on bulk snapshot [#3925](https://github.com/vatesfr/xen-orchestra/issues/3925) (PR [#3933](https://github.com/vatesfr/xen-orchestra/pull/3933)) +- Work-around the XenServer issue when `VBD#VDI` is an empty string instead of an opaque reference (PR [#3950](https://github.com/vatesfr/xen-orchestra/pull/3950)) ### Bug fixes @@ -15,6 +16,7 @@ ### Released packages +- xen-api v0.24.2 - @xen-orchestra/fs v0.6.1 - xo-server-auth-saml v0.5.3 - xo-server v5.35.0 diff --git a/packages/xen-api/src/index.js b/packages/xen-api/src/index.js index 116233c7b..ee5d42c3f 100644 --- a/packages/xen-api/src/index.js +++ b/packages/xen-api/src/index.js @@ -1097,7 +1097,10 @@ export class Xapi extends EventEmitter { props[`update_${field}`] = function(entries) { return xapi.setFieldEntries(this, field, entries) } - } else if (isOpaqueRef(value)) { + } else if (value === '' || isOpaqueRef(value)) { + // 2019-02-07 - JFT: even if `value` should not be an empty string for + // a ref property, an user had the case on XenServer 7.0 on the CD VBD + // of a VM created by XenCenter getters[$field] = function() { return objectsByRef[this[field]] }