Use new SR.is_tools_sr and VDI.is_tools_iso fields to detect the Tools SR/VDI

If the new field is not present, we'll fall back to the old method, which is by
name_label (SR.is_tools_sr/VDI.is_tools_iso will be false in that case).

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
This commit is contained in:
Rob Hoes 2016-01-29 15:33:45 +00:00
parent 27bd60a77f
commit b9f4d24ca7
2 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) Citrix Systems Inc. /* Copyright (c) Citrix Systems Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, * Redistribution and use in source and binary forms,
@ -141,7 +141,8 @@ namespace XenAdmin.Actions
foreach (VDI vdi in Connection.ResolveAllShownXenModelObjects(sr.VDIs, searchHiddenISOs)) foreach (VDI vdi in Connection.ResolveAllShownXenModelObjects(sr.VDIs, searchHiddenISOs))
{ {
if (ISONameOld.Equals(vdi.name_label) || if (ISONameOld.Equals(vdi.name_label) ||
ISONameNew.Equals(vdi.name_label)) ISONameNew.Equals(vdi.name_label) ||
vdi.is_tools_iso)
{ {
return vdi; return vdi;
} }

View File

@ -1,4 +1,4 @@
/* Copyright (c) Citrix Systems Inc. /* Copyright (c) Citrix Systems Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, * Redistribution and use in source and binary forms,
@ -135,7 +135,7 @@ namespace XenAPI
{ {
get get
{ {
return name_label == SR.XenServer_Tools_Label; return name_label == SR.XenServer_Tools_Label || is_tools_sr;
} }
} }