CA-201421: tools ISO is missing in drop-down list

This commit is contained in:
Stephen Turner 2016-02-25 17:18:48 +00:00
parent 7867901e0d
commit 5093ef677c
3 changed files with 20 additions and 11 deletions

View File

@ -257,8 +257,7 @@ namespace XenAdmin.Controls
{
foreach (VDI vdi in connection.ResolveAll<VDI>(srWrapper.item.VDIs))
{
if(Actions.InstallPVToolsAction.ISONameOld.Equals(vdi.name_label) ||
Actions.InstallPVToolsAction.ISONameNew.Equals(vdi.name_label))
if (vdi.IsToolsIso)
items.Add(new ToStringWrapper<VDI>(vdi, " " + vdi.Name));
}
}

View File

@ -44,10 +44,6 @@ namespace XenAdmin.Actions
private readonly Action _xsToolsNotFound;
private readonly bool _searchHiddenIsOs;
// The 'well known' name of the ISO containing our PV tools.
public const string ISONameOld = "xswindrivers.iso";
public const string ISONameNew = "xs-tools.iso";
public InstallPVToolsAction(VM vm, Action xsToolsNotfound, bool searchHiddenISOs)
: base(vm.Connection, string.Format(Messages.INSTALLTOOLS_TITLE, vm.Name))
{
@ -140,12 +136,8 @@ namespace XenAdmin.Actions
{
foreach (VDI vdi in Connection.ResolveAllShownXenModelObjects(sr.VDIs, searchHiddenISOs))
{
if (ISONameOld.Equals(vdi.name_label) ||
ISONameNew.Equals(vdi.name_label) ||
vdi.is_tools_iso)
{
if (vdi.IsToolsIso)
return vdi;
}
}
}
}

View File

@ -300,6 +300,24 @@ namespace XenAPI
get { return other_config.ContainsKey("config-drive") && other_config["config-drive"].ToLower() == "true"; }
}
/// <summary>
/// Whether this is a Tools ISO. Finds the old method (by name) as well as
/// the new method (field on the VDI).
/// </summary>
public bool IsToolsIso
{
get
{
const string ISONameOld = "xswindrivers.iso";
const string ISONameNew = "xs-tools.iso";
return
is_tools_iso ||
ISONameOld.Equals(name_label) ||
ISONameNew.Equals(name_label);
}
}
/// <summary>
/// Whether read caching is enabled on this disk on a specific host