mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 15:29:26 +01:00
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:
parent
018dfb8e79
commit
f62cc5c521
@ -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)
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user