CA-279502: Added check for the server version before calling VM.get_is_default_template

This fixes the error thrown when importing templates with XenCenter 7.3 on servers earlier than 7.2

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2018-01-12 10:45:22 +00:00 committed by Konstantina Chremmou
parent 018dfb8e79
commit f62cc5c521
2 changed files with 3 additions and 3 deletions

View File

@ -146,7 +146,7 @@ namespace XenAdmin.Actions
throw new CancelledException(); throw new CancelledException();
isTemplate = VM.get_is_a_template(Session, vmRef); isTemplate = VM.get_is_a_template(Session, vmRef);
if (isTemplate && VM.get_is_default_template(Session, vmRef)) if (isTemplate && Helpers.FalconOrGreater(Connection) && VM.get_is_default_template(Session, vmRef))
{ {
var otherConfig = VM.get_other_config(Session, vmRef); var otherConfig = VM.get_other_config(Session, vmRef);
if (!otherConfig.ContainsKey(IMPORT_TASK) || otherConfig[IMPORT_TASK] != RelatedTask.opaque_ref) if (!otherConfig.ContainsKey(IMPORT_TASK) || otherConfig[IMPORT_TASK] != RelatedTask.opaque_ref)

View File

@ -1029,7 +1029,7 @@ namespace XenAPI
/// <summary> /// <summary>
/// Get the is_default_template field of the given VM. /// Get the is_default_template field of the given VM.
/// First published in XenServer 7.1. /// First published in XenServer 7.2.
/// </summary> /// </summary>
/// <param name="session">The session</param> /// <param name="session">The session</param>
/// <param name="_vm">The opaque_ref of the given vm</param> /// <param name="_vm">The opaque_ref of the given vm</param>
@ -4282,7 +4282,7 @@ namespace XenAPI
/// <summary> /// <summary>
/// true if this is a default template. Default template VMs can never be started or migrated, they are used only for cloning other VMs /// true if this is a default template. Default template VMs can never be started or migrated, they are used only for cloning other VMs
/// First published in XenServer 7.1. /// First published in XenServer 7.2.
/// </summary> /// </summary>
public virtual bool is_default_template public virtual bool is_default_template
{ {