mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 20:36:33 +01:00
Merge pull request #2510 from xenserver/feature/REQ-775
Merge REQ-775 into master
This commit is contained in:
commit
61f6f89c25
@ -120,6 +120,10 @@ namespace CFUValidator
|
||||
Status = "Determining XenServer update required...";
|
||||
var updateAlerts = XenAdmin.Core.Updates.NewXenServerVersionAlerts(xenServerVersions).Where(alert => !alert.CanIgnore).ToList();
|
||||
|
||||
HfxEligibilityValidator hfxEligibilityValidator = new HfxEligibilityValidator(xenServerVersions);
|
||||
Status = "Running hotfix eligibility check...";
|
||||
RunHfxEligibilityValidator(hfxEligibilityValidator);
|
||||
|
||||
Status = "Determining patches required...";
|
||||
var patchAlerts = XenAdmin.Core.Updates.NewXenServerPatchAlerts(xenServerVersions, xenServerPatches).Where(alert => !alert.CanIgnore).ToList();
|
||||
|
||||
@ -133,9 +137,9 @@ namespace CFUValidator
|
||||
|
||||
Status = "Running patch check(s), this may take some time...";
|
||||
RunValidators(validators);
|
||||
|
||||
|
||||
Status = "Generating summary...";
|
||||
GeneratePatchSummary(patchAlerts, validators, updateAlerts, xcupdateAlerts);
|
||||
GeneratePatchSummary(patchAlerts, validators, hfxEligibilityValidator, updateAlerts, xcupdateAlerts);
|
||||
}
|
||||
|
||||
private void CheckProvidedVersionNumber(List<XenServerVersion> xenServerVersions)
|
||||
@ -190,18 +194,25 @@ namespace CFUValidator
|
||||
Status = "Validator checks complete";
|
||||
}
|
||||
|
||||
private void RunHfxEligibilityValidator(HfxEligibilityValidator validator)
|
||||
{
|
||||
validator.Validate();
|
||||
Status = "Hotfix Eligibility Validator check complete";
|
||||
}
|
||||
|
||||
private void validator_StatusChanged(object sender, EventArgs e)
|
||||
{
|
||||
Status = sender as string;
|
||||
}
|
||||
|
||||
private void GeneratePatchSummary(List<XenServerPatchAlert> alerts, List<AlertFeatureValidator> validators,
|
||||
private void GeneratePatchSummary(List<XenServerPatchAlert> alerts, List<AlertFeatureValidator> validators, HfxEligibilityValidator hfxEligibilityValidator,
|
||||
List<XenServerVersionAlert> updateAlerts, List<XenCenterUpdateAlert> xcupdateAlerts)
|
||||
{
|
||||
OuputComponent oc = new OutputTextOuputComponent(XmlLocation, ServerVersion);
|
||||
XenCenterUpdateDecorator xcud = new XenCenterUpdateDecorator(oc, xcupdateAlerts);
|
||||
XenServerUpdateDecorator xsud = new XenServerUpdateDecorator(xcud, updateAlerts);
|
||||
PatchAlertDecorator pad = new PatchAlertDecorator(xsud, alerts);
|
||||
HfxEligibilityValidatorDecorator hevd = new HfxEligibilityValidatorDecorator(xsud, hfxEligibilityValidator, "Hotfix eligibility check:");
|
||||
PatchAlertDecorator pad = new PatchAlertDecorator(hevd, alerts);
|
||||
AlertFeatureValidatorDecorator afdCoreFields = new AlertFeatureValidatorDecorator(pad,
|
||||
validators.First(v => v is CorePatchDetailsValidator),
|
||||
"Core fields in patch checks:");
|
||||
@ -212,7 +223,7 @@ namespace CFUValidator
|
||||
validators.First(v => v is ZipContentsValidator),
|
||||
"Required patch zip content checks:");
|
||||
|
||||
if(CheckHotfixContents)
|
||||
if (CheckHotfixContents)
|
||||
Output = afdZipContents.Generate().Insert(0, Output).ToString();
|
||||
else
|
||||
Output = afdPatchUrl.Generate().Insert(0, Output).ToString();
|
||||
|
@ -66,6 +66,7 @@
|
||||
<Compile Include="CommandLineOptions\CommandLineParser.cs" />
|
||||
<Compile Include="ConsoleSpinner.cs" />
|
||||
<Compile Include="OutputDecorators\AlertFeatureValidatorDecorator.cs" />
|
||||
<Compile Include="OutputDecorators\HfxEligibilityValidatorDecorator.cs" />
|
||||
<Compile Include="OutputDecorators\OuputComponent.cs" />
|
||||
<Compile Include="OutputDecorators\Decorator.cs" />
|
||||
<Compile Include="OutputDecorators\PatchAlertDecorator.cs" />
|
||||
@ -78,6 +79,7 @@
|
||||
<Compile Include="Updates\ICheckForUpdatesXMLSource.cs" />
|
||||
<Compile Include="Updates\XmlRetrieverFactory.cs" />
|
||||
<Compile Include="Validators\AlertFeatureValidator.cs" />
|
||||
<Compile Include="Validators\HfxEligibilityValidator.cs" />
|
||||
<Compile Include="Validators\CorePatchDetailsValidator.cs" />
|
||||
<Compile Include="Validators\PatchURLValidator.cs" />
|
||||
<Compile Include="Validators\ZipContentsValidator.cs" />
|
||||
|
@ -0,0 +1,60 @@
|
||||
/* Copyright (c) Citrix Systems, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
* with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using CFUValidator.Validators;
|
||||
|
||||
namespace CFUValidator.OutputDecorators
|
||||
{
|
||||
class HfxEligibilityValidatorDecorator : Decorator
|
||||
{
|
||||
private readonly string header;
|
||||
private readonly HfxEligibilityValidator validator;
|
||||
public HfxEligibilityValidatorDecorator(OuputComponent ouputComponent, HfxEligibilityValidator validator, string header)
|
||||
{
|
||||
SetComponent(ouputComponent);
|
||||
this.validator = validator;
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public override StringBuilder Generate()
|
||||
{
|
||||
StringBuilder sb = base.Generate();
|
||||
sb.AppendLine(header);
|
||||
if (validator.ErrorsFound)
|
||||
validator.Results.ForEach(v => sb.AppendLine(v));
|
||||
else
|
||||
sb.AppendLine("all OK");
|
||||
return sb.AppendLine(String.Empty);
|
||||
}
|
||||
}
|
||||
}
|
72
CFUValidator/Validators/HfxEligibilityValidator.cs
Normal file
72
CFUValidator/Validators/HfxEligibilityValidator.cs
Normal file
@ -0,0 +1,72 @@
|
||||
/* Copyright (c) Citrix Systems, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
* with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using XenAdmin.Alerts;
|
||||
using XenAdmin.Core;
|
||||
|
||||
namespace CFUValidator.Validators
|
||||
{
|
||||
class HfxEligibilityValidator
|
||||
{
|
||||
private List<XenServerVersion> xsversions;
|
||||
public List<string> Results { get; set; }
|
||||
|
||||
public HfxEligibilityValidator(List<XenServerVersion> xsversions)
|
||||
{
|
||||
this.xsversions = xsversions;
|
||||
Results = new List<string>();
|
||||
}
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
foreach (XenServerVersion version in xsversions)
|
||||
{
|
||||
DateSanityCheck(version);
|
||||
}
|
||||
}
|
||||
|
||||
private void DateSanityCheck(XenServerVersion version)
|
||||
{
|
||||
if (version.HotfixEligibility == hotfix_eligibility.none && version.EolDate == DateTime.MinValue)
|
||||
Results.Add("Missing or wrong eol-date field on: " + version.Name);
|
||||
if (version.HotfixEligibility == hotfix_eligibility.premium && version.HotfixEligibilityPremiumDate == DateTime.MinValue)
|
||||
Results.Add("Missing or wrong hotfix-eligibility-premium-date field on: " + version.Name);
|
||||
if (version.HotfixEligibility == hotfix_eligibility.cu && version.HotfixEligibilityNoneDate == DateTime.MinValue)
|
||||
Results.Add("Missing or wrong hotfix-eligibility-none-date field on: " + version.Name);
|
||||
if (version.HotfixEligibility == hotfix_eligibility.cu && version.HotfixEligibilityPremiumDate == DateTime.MinValue)
|
||||
Results.Add("Missing or wrong hotfix-eligibility-premium-date field on: " + version.Name);
|
||||
}
|
||||
|
||||
public bool ErrorsFound { get { return Results.Count > 0; } }
|
||||
}
|
||||
}
|
137
XenAdmin/Alerts/Types/HotfixEligibilityAlert.cs
Normal file
137
XenAdmin/Alerts/Types/HotfixEligibilityAlert.cs
Normal file
@ -0,0 +1,137 @@
|
||||
/* Copyright (c) Citrix Systems, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
* with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using XenAdmin.Core;
|
||||
using XenAdmin.Network;
|
||||
using XenAPI;
|
||||
|
||||
namespace XenAdmin.Alerts.Types
|
||||
{
|
||||
public class HotfixEligibilityAlert: Alert
|
||||
{
|
||||
private readonly Pool pool;
|
||||
public readonly XenServerVersion Version;
|
||||
|
||||
public HotfixEligibilityAlert(IXenConnection connection, XenServerVersion version)
|
||||
{
|
||||
Connection = connection;
|
||||
this.Version = version;
|
||||
pool = Helpers.GetPoolOfOne(connection);
|
||||
_timestamp = DateTime.Now;
|
||||
}
|
||||
|
||||
#region Overrides of Alert
|
||||
|
||||
public override string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
if (pool == null || Version == null)
|
||||
return string.Empty;
|
||||
|
||||
var productVersionText = string.Format(Messages.STRING_SPACE_STRING,
|
||||
Helpers.NaplesOrGreater(Connection) ? Messages.XENSERVER : Messages.XENSERVER_LEGACY,
|
||||
Helpers.GetMaster(Connection)?.ProductVersionText());
|
||||
|
||||
switch (Version.HotfixEligibility)
|
||||
{
|
||||
case hotfix_eligibility.premium:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_ALERT_TITLE_FREE, productVersionText);
|
||||
case hotfix_eligibility.cu when pool.IsFreeLicenseOrExpired():
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_ALERT_TITLE_FREE, productVersionText);
|
||||
case hotfix_eligibility.cu:
|
||||
return Messages.HOTFIX_ELIGIBILITY_ALERT_TITLE_CU;
|
||||
case hotfix_eligibility.none:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_ALERT_TITLE_EOL, productVersionText);
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
if (pool == null)
|
||||
return string.Empty;
|
||||
|
||||
var versionText = Helpers.GetMaster(Connection)?.ProductVersionText();
|
||||
var productVersionText = string.Format(Messages.STRING_SPACE_STRING,
|
||||
Helpers.NaplesOrGreater(Connection) ? Messages.XENSERVER : Messages.XENSERVER_LEGACY,
|
||||
versionText);
|
||||
var unlicensed = pool.IsFreeLicenseOrExpired();
|
||||
|
||||
switch (Version.HotfixEligibility)
|
||||
{
|
||||
// premium
|
||||
case hotfix_eligibility.premium when Version.HotfixEligibilityPremiumDate != DateTime.MinValue:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_FREE, productVersionText, HelpersGUI.DateTimeToString(Version.HotfixEligibilityPremiumDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
|
||||
|
||||
// cu
|
||||
case hotfix_eligibility.cu when unlicensed && Version.HotfixEligibilityPremiumDate != DateTime.MinValue:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_FREE, productVersionText, HelpersGUI.DateTimeToString(Version.HotfixEligibilityPremiumDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
|
||||
case hotfix_eligibility.cu when !unlicensed && Version.HotfixEligibilityNoneDate != DateTime.MinValue:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_CU, productVersionText, HelpersGUI.DateTimeToString(Version.HotfixEligibilityNoneDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true), versionText);
|
||||
|
||||
// none
|
||||
case hotfix_eligibility.none when unlicensed && Version.EolDate != DateTime.MinValue:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_EOL_FREE, productVersionText, HelpersGUI.DateTimeToString(Version.EolDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
|
||||
case hotfix_eligibility.none when Version.EolDate != DateTime.MinValue:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_EOL, productVersionText, HelpersGUI.DateTimeToString(Version.EolDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
|
||||
|
||||
// default
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override AlertPriority Priority => AlertPriority.Priority3;
|
||||
|
||||
public override string AppliesTo => Helpers.GetName(Helpers.GetPoolOfOne(Connection));
|
||||
|
||||
public override string FixLinkText => null;
|
||||
|
||||
public override Action FixLinkAction => null;
|
||||
|
||||
public override string HelpID => "HotfixEligibilityAlert";
|
||||
|
||||
public override bool Equals(Alert other)
|
||||
{
|
||||
if (other is HotfixEligibilityAlert alert)
|
||||
return Connection == alert.Connection && Version == alert.Version;
|
||||
return base.Equals(other);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -41,6 +41,7 @@ using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using XenAdmin.Dialogs;
|
||||
using System.Text;
|
||||
using XenAdmin.Alerts.Types;
|
||||
using XenCenterLib;
|
||||
|
||||
namespace XenAdmin.Core
|
||||
@ -943,5 +944,67 @@ namespace XenAdmin.Core
|
||||
return null;
|
||||
return FindPatchAlert(p => p.Name.Equals(patchName, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
public static hotfix_eligibility HotfixEligibility(Host host, out XenServerVersion xenServerVersion)
|
||||
{
|
||||
xenServerVersion = null;
|
||||
if (XenServerVersions == null)
|
||||
return hotfix_eligibility.all;
|
||||
|
||||
xenServerVersion = GetServerVersions(host, XenServerVersions).FirstOrDefault();
|
||||
|
||||
return xenServerVersion?.HotfixEligibility ?? hotfix_eligibility.all;
|
||||
}
|
||||
|
||||
public static void CheckHotfixEligibility(IXenConnection connection)
|
||||
{
|
||||
var master = Helpers.GetMaster(connection);
|
||||
if (master == null)
|
||||
return;
|
||||
|
||||
var hotfixEligibility = HotfixEligibility(master, out var xenServerVersion);
|
||||
|
||||
if (xenServerVersion == null || hotfixEligibility == hotfix_eligibility.all ||
|
||||
hotfixEligibility == hotfix_eligibility.premium && !master.IsFreeLicenseOrExpired())
|
||||
{
|
||||
Alert.RemoveAlert(a => a is HotfixEligibilityAlert && connection.Equals(a.Connection));
|
||||
return;
|
||||
}
|
||||
|
||||
var alertIndex = Alert.FindAlertIndex(a => a is HotfixEligibilityAlert alert && connection.Equals(alert.Connection) && xenServerVersion == alert.Version);
|
||||
if (alertIndex == -1)
|
||||
{
|
||||
Alert.RemoveAlert(a => a is HotfixEligibilityAlert && connection.Equals(a.Connection)); // ensure that there is no other alert for this connection
|
||||
Alert.AddAlert(new HotfixEligibilityAlert(connection, xenServerVersion));
|
||||
}
|
||||
else
|
||||
Alert.RefreshAlertAt(alertIndex);
|
||||
}
|
||||
|
||||
public static void CheckHotfixEligibility()
|
||||
{
|
||||
var alerts = new List<HotfixEligibilityAlert>();
|
||||
|
||||
foreach (var connection in ConnectionsManager.XenConnectionsCopy)
|
||||
{
|
||||
if (!connection.IsConnected)
|
||||
continue;
|
||||
|
||||
var master = Helpers.GetMaster(connection);
|
||||
if (master == null)
|
||||
continue;
|
||||
|
||||
var hotfixEligibility = HotfixEligibility(master, out var xenServerVersion);
|
||||
|
||||
if (xenServerVersion == null || hotfixEligibility == hotfix_eligibility.all ||
|
||||
hotfixEligibility == hotfix_eligibility.premium && !master.IsFreeLicenseOrExpired())
|
||||
continue;
|
||||
|
||||
alerts.Add(new HotfixEligibilityAlert(connection, xenServerVersion));
|
||||
}
|
||||
|
||||
Alert.RemoveAlert(a => a is HotfixEligibilityAlert);
|
||||
Alert.AddAlertRange(alerts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -117,18 +117,18 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="AdPasswordPromptDisable" xml:space="preserve">
|
||||
<value>rbac-join-domain</value>
|
||||
</data>
|
||||
<data name="AdPasswordPromptEnable" xml:space="preserve">
|
||||
<value>rbac-join-domain</value>
|
||||
</data>
|
||||
<data name="AddServerDialog" xml:space="preserve">
|
||||
<value>hosts-add</value>
|
||||
</data>
|
||||
<data name="AddVGPUDialog" xml:space="preserve">
|
||||
<value>vgpu-add</value>
|
||||
</data>
|
||||
<data name="AdPasswordPromptDisable" xml:space="preserve">
|
||||
<value>rbac-join-domain</value>
|
||||
</data>
|
||||
<data name="AdPasswordPromptEnable" xml:space="preserve">
|
||||
<value>rbac-join-domain</value>
|
||||
</data>
|
||||
<data name="AlertSummaryDialog" xml:space="preserve">
|
||||
<value>systemalerts</value>
|
||||
</data>
|
||||
@ -249,6 +249,21 @@
|
||||
<data name="CustomFieldsDialog" xml:space="preserve">
|
||||
<value>resources-customfields</value>
|
||||
</data>
|
||||
<data name="DefaultHelpTopic" xml:space="preserve">
|
||||
<value>intro-welcome</value>
|
||||
</data>
|
||||
<data name="DisableWLBDialog" xml:space="preserve">
|
||||
<value>wlb-disable</value>
|
||||
</data>
|
||||
<data name="DisconnectServerWarningDialog" xml:space="preserve">
|
||||
<value>hosts-disconnect</value>
|
||||
</data>
|
||||
<data name="DiskUsageMessageAlert" xml:space="preserve">
|
||||
<value>systemalerts</value>
|
||||
</data>
|
||||
<data name="Dom0MemoryDemandUsageMessageAlert" xml:space="preserve">
|
||||
<value>systemalerts</value>
|
||||
</data>
|
||||
<data name="DRConfigureDialog" xml:space="preserve">
|
||||
<value>dr-config</value>
|
||||
</data>
|
||||
@ -270,10 +285,10 @@
|
||||
<data name="DRFailoverWizard_Dryrun_StoragePane" xml:space="preserve">
|
||||
<value>dr-testfailover</value>
|
||||
</data>
|
||||
<data name="DRFailoverWizard_Dryrun_WelcomePane" xml:space="preserve">
|
||||
<data name="DRFailoverWizard_Dryrun_vAppsPane" xml:space="preserve">
|
||||
<value>dr-testfailover</value>
|
||||
</data>
|
||||
<data name="DRFailoverWizard_Dryrun_vAppsPane" xml:space="preserve">
|
||||
<data name="DRFailoverWizard_Dryrun_WelcomePane" xml:space="preserve">
|
||||
<value>dr-testfailover</value>
|
||||
</data>
|
||||
<data name="DRFailoverWizard_Failback_BeforeYouStartPane" xml:space="preserve">
|
||||
@ -294,10 +309,10 @@
|
||||
<data name="DRFailoverWizard_Failback_StoragePane" xml:space="preserve">
|
||||
<value>dr-failback</value>
|
||||
</data>
|
||||
<data name="DRFailoverWizard_Failback_WelcomePane" xml:space="preserve">
|
||||
<data name="DRFailoverWizard_Failback_vAppsPane" xml:space="preserve">
|
||||
<value>dr-failback</value>
|
||||
</data>
|
||||
<data name="DRFailoverWizard_Failback_vAppsPane" xml:space="preserve">
|
||||
<data name="DRFailoverWizard_Failback_WelcomePane" xml:space="preserve">
|
||||
<value>dr-failback</value>
|
||||
</data>
|
||||
<data name="DRFailoverWizard_Failover_BeforeYouStartPane" xml:space="preserve">
|
||||
@ -318,10 +333,10 @@
|
||||
<data name="DRFailoverWizard_Failover_StoragePane" xml:space="preserve">
|
||||
<value>dr-failover</value>
|
||||
</data>
|
||||
<data name="DRFailoverWizard_Failover_WelcomePane" xml:space="preserve">
|
||||
<data name="DRFailoverWizard_Failover_vAppsPane" xml:space="preserve">
|
||||
<value>dr-failover</value>
|
||||
</data>
|
||||
<data name="DRFailoverWizard_Failover_vAppsPane" xml:space="preserve">
|
||||
<data name="DRFailoverWizard_Failover_WelcomePane" xml:space="preserve">
|
||||
<value>dr-failover</value>
|
||||
</data>
|
||||
<data name="DRFailoverWizard_RbacPane" xml:space="preserve">
|
||||
@ -330,21 +345,6 @@
|
||||
<data name="DRFailoverWizard_WelcomePane" xml:space="preserve">
|
||||
<value>dr-failover</value>
|
||||
</data>
|
||||
<data name="DefaultHelpTopic" xml:space="preserve">
|
||||
<value>intro-welcome</value>
|
||||
</data>
|
||||
<data name="DisableWLBDialog" xml:space="preserve">
|
||||
<value>wlb-disable</value>
|
||||
</data>
|
||||
<data name="DisconnectServerWarningDialog" xml:space="preserve">
|
||||
<value>hosts-disconnect</value>
|
||||
</data>
|
||||
<data name="DiskUsageMessageAlert" xml:space="preserve">
|
||||
<value>systemalerts</value>
|
||||
</data>
|
||||
<data name="Dom0MemoryDemandUsageMessageAlert" xml:space="preserve">
|
||||
<value>systemalerts</value>
|
||||
</data>
|
||||
<data name="DummyAlert" xml:space="preserve">
|
||||
<value>systemalerts</value>
|
||||
</data>
|
||||
@ -378,6 +378,12 @@
|
||||
<data name="EditVMGeneralSettingsDialog" xml:space="preserve">
|
||||
<value>vms-properties</value>
|
||||
</data>
|
||||
<data name="EditVmHaPrioritiesDialog" xml:space="preserve">
|
||||
<value>pools-ha-config</value>
|
||||
</data>
|
||||
<data name="EditVmNetworkSettingsDialog" xml:space="preserve">
|
||||
<value>vms-network-properties</value>
|
||||
</data>
|
||||
<data name="EditVMPPGeneralSettingsDialog" xml:space="preserve">
|
||||
<value>6536</value>
|
||||
</data>
|
||||
@ -390,12 +396,6 @@
|
||||
<data name="EditVM_applianceGeneralSettingsDialog" xml:space="preserve">
|
||||
<value>vapps-properties</value>
|
||||
</data>
|
||||
<data name="EditVmHaPrioritiesDialog" xml:space="preserve">
|
||||
<value>pools-ha-config</value>
|
||||
</data>
|
||||
<data name="EditVmNetworkSettingsDialog" xml:space="preserve">
|
||||
<value>vms-network-properties</value>
|
||||
</data>
|
||||
<data name="EnablePvsReadCachingDialog" xml:space="preserve">
|
||||
<value>pvs-read-cache</value>
|
||||
</data>
|
||||
@ -474,24 +474,27 @@
|
||||
<data name="HADropInNtolAlert" xml:space="preserve">
|
||||
<value>pools-ha-about</value>
|
||||
</data>
|
||||
<data name="HAOvercommittedAlert" xml:space="preserve">
|
||||
<value>pools-ha-about</value>
|
||||
</data>
|
||||
<data name="HAWizard" xml:space="preserve">
|
||||
<value>pools-ha-enable</value>
|
||||
</data>
|
||||
<data name="HaNtolMax" xml:space="preserve">
|
||||
<value>pools-ha-config</value>
|
||||
</data>
|
||||
<data name="HaNtolZero" xml:space="preserve">
|
||||
<value>pools-ha-config</value>
|
||||
</data>
|
||||
<data name="HAOvercommittedAlert" xml:space="preserve">
|
||||
<value>pools-ha-about</value>
|
||||
</data>
|
||||
<data name="HAWizard" xml:space="preserve">
|
||||
<value>pools-ha-enable</value>
|
||||
</data>
|
||||
<data name="HealthCheckOverviewDialog" xml:space="preserve">
|
||||
<value>health-check</value>
|
||||
</data>
|
||||
<data name="HealthCheckSettingsDialog" xml:space="preserve">
|
||||
<value>health-check</value>
|
||||
</data>
|
||||
<data name="HotfixEligibilityAlert" xml:space="preserve">
|
||||
<value>updates-about</value>
|
||||
</data>
|
||||
<data name="ImportWizard_GlobalSelectHostPane" xml:space="preserve">
|
||||
<value>vms-import</value>
|
||||
</data>
|
||||
@ -570,9 +573,6 @@
|
||||
<data name="IscsiDeviceConfigDialog" xml:space="preserve">
|
||||
<value>dr-testfailover</value>
|
||||
</data>
|
||||
<data name="LVMoHBAWarningDialog" xml:space="preserve">
|
||||
<value>storage-pools-add-hba</value>
|
||||
</data>
|
||||
<data name="LicenseKeyDialog" xml:space="preserve">
|
||||
<value>licensing-about</value>
|
||||
</data>
|
||||
@ -585,6 +585,9 @@
|
||||
<data name="LogWindow" xml:space="preserve">
|
||||
<value>troubleshooting-eventlog</value>
|
||||
</data>
|
||||
<data name="LVMoHBAWarningDialog" xml:space="preserve">
|
||||
<value>storage-pools-add-hba</value>
|
||||
</data>
|
||||
<data name="ManageUpdatesDialog" xml:space="preserve">
|
||||
<value>updates-applying</value>
|
||||
</data>
|
||||
@ -624,12 +627,12 @@
|
||||
<data name="MissingIqnAlert" xml:space="preserve">
|
||||
<value>systemalerts</value>
|
||||
</data>
|
||||
<data name="MoveVMDialog" xml:space="preserve">
|
||||
<value>vms-relocate</value>
|
||||
</data>
|
||||
<data name="MoveVirtualDiskDialog" xml:space="preserve">
|
||||
<value>vms-storage-move</value>
|
||||
</data>
|
||||
<data name="MoveVMDialog" xml:space="preserve">
|
||||
<value>vms-relocate</value>
|
||||
</data>
|
||||
<data name="NameAndConnectionPrompt" xml:space="preserve">
|
||||
<value>resources-searching-saved</value>
|
||||
</data>
|
||||
@ -759,15 +762,15 @@
|
||||
<data name="NewVMApplianceWizard_RbacPane" xml:space="preserve">
|
||||
<value>vapps-create</value>
|
||||
</data>
|
||||
<data name="NewVMApplianceWizard_vAppNamePane" xml:space="preserve">
|
||||
<value>vapps-create</value>
|
||||
</data>
|
||||
<data name="NewVMApplianceWizard_VMOrderAndDelaysPane" xml:space="preserve">
|
||||
<value>vapps-create</value>
|
||||
</data>
|
||||
<data name="NewVMApplianceWizard_VMsPane" xml:space="preserve">
|
||||
<value>vapps-create</value>
|
||||
</data>
|
||||
<data name="NewVMApplianceWizard_vAppNamePane" xml:space="preserve">
|
||||
<value>vapps-create</value>
|
||||
</data>
|
||||
<data name="NewVMNetworkWizard" xml:space="preserve">
|
||||
<value>vms-network</value>
|
||||
</data>
|
||||
@ -777,15 +780,15 @@
|
||||
<data name="NewVMWizard_BIOSStringsPane" xml:space="preserve">
|
||||
<value>vms-new-template</value>
|
||||
</data>
|
||||
<data name="NewVMWizard_CPU&MemoryPane" xml:space="preserve">
|
||||
<value>vms-new-cpu-memory</value>
|
||||
</data>
|
||||
<data name="NewVMWizard_CdMediaPane" xml:space="preserve">
|
||||
<value>vms-new-media</value>
|
||||
</data>
|
||||
<data name="NewVMWizard_CloudConfigParametersPane" xml:space="preserve">
|
||||
<value>vms-new-cloudconfig</value>
|
||||
</data>
|
||||
<data name="NewVMWizard_CPU&MemoryPane" xml:space="preserve">
|
||||
<value>vms-new-cpu-memory</value>
|
||||
</data>
|
||||
<data name="NewVMWizard_FinishPane" xml:space="preserve">
|
||||
<value>vms-new-finish</value>
|
||||
</data>
|
||||
@ -804,12 +807,12 @@
|
||||
<data name="NewVMWizard_NamePane" xml:space="preserve">
|
||||
<value>vms-new-media</value>
|
||||
</data>
|
||||
<data name="NewVMWizard_NetworkMediaPane" xml:space="preserve">
|
||||
<value>vms-new-media</value>
|
||||
</data>
|
||||
<data name="NewVMWizard_NetworkingPane" xml:space="preserve">
|
||||
<value>vms-new-networking</value>
|
||||
</data>
|
||||
<data name="NewVMWizard_NetworkMediaPane" xml:space="preserve">
|
||||
<value>vms-new-media</value>
|
||||
</data>
|
||||
<data name="NewVMWizard_PermissionChecksPane" xml:space="preserve">
|
||||
<value>vms-new</value>
|
||||
</data>
|
||||
@ -915,6 +918,9 @@
|
||||
<data name="RollingUpgradeWizard_UpgradeextrasPane" xml:space="preserve">
|
||||
<value>upgrade</value>
|
||||
</data>
|
||||
<data name="RollingUpgradeWizard_upgrademethodPane" xml:space="preserve">
|
||||
<value>upgrade</value>
|
||||
</data>
|
||||
<data name="RollingUpgradeWizard_UpgrademodePane" xml:space="preserve">
|
||||
<value>upgrade</value>
|
||||
</data>
|
||||
@ -924,9 +930,6 @@
|
||||
<data name="RollingUpgradeWizard_UpgradeprechecksPane" xml:space="preserve">
|
||||
<value>upgrade</value>
|
||||
</data>
|
||||
<data name="RollingUpgradeWizard_upgrademethodPane" xml:space="preserve">
|
||||
<value>upgrade</value>
|
||||
</data>
|
||||
<data name="SaveAndRestoreDialog" xml:space="preserve">
|
||||
<value>hosts-connect-save</value>
|
||||
</data>
|
||||
@ -957,10 +960,10 @@
|
||||
<data name="TabPageBallooning" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageCPUMemory" xml:space="preserve">
|
||||
<data name="TabPageConsole" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageConsole" xml:space="preserve">
|
||||
<data name="TabPageCPUMemory" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageDockerDetails" xml:space="preserve">
|
||||
@ -984,12 +987,6 @@
|
||||
<data name="TabPageHome" xml:space="preserve">
|
||||
<value>intro-welcome</value>
|
||||
</data>
|
||||
<data name="TabPageNICs" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageNICs_Dedicate" xml:space="preserve">
|
||||
<value>hosts-nics</value>
|
||||
</data>
|
||||
<data name="TabPageNetwork" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
@ -999,15 +996,18 @@
|
||||
<data name="TabPageNetworkVM" xml:space="preserve">
|
||||
<value>vms-network</value>
|
||||
</data>
|
||||
<data name="TabPageNICs" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageNICs_Dedicate" xml:space="preserve">
|
||||
<value>hosts-nics</value>
|
||||
</data>
|
||||
<data name="TabPagePerformance" xml:space="preserve">
|
||||
<value>performance</value>
|
||||
</data>
|
||||
<data name="TabPagePvs" xml:space="preserve">
|
||||
<value>pvs-read-cache</value>
|
||||
</data>
|
||||
<data name="TabPageSR" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageSearch" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
@ -1020,6 +1020,9 @@
|
||||
<data name="TabPageSnapshots" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageSR" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageStorage" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
@ -1038,12 +1041,12 @@
|
||||
<data name="TabPageTagCloud" xml:space="preserve">
|
||||
<value>resources-tagging</value>
|
||||
</data>
|
||||
<data name="TabPageUSB" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageUnknown" xml:space="preserve">
|
||||
<value>intro-xencenterwindow</value>
|
||||
</data>
|
||||
<data name="TabPageUSB" xml:space="preserve">
|
||||
<value>tabs</value>
|
||||
</data>
|
||||
<data name="TabPageWLB" xml:space="preserve">
|
||||
<value>wlb-get-started-help</value>
|
||||
</data>
|
||||
@ -1056,6 +1059,9 @@
|
||||
<data name="UpdatesDialog" xml:space="preserve">
|
||||
<value>updates-applying</value>
|
||||
</data>
|
||||
<data name="VcpuWarningDialog" xml:space="preserve">
|
||||
<value>vms-properties</value>
|
||||
</data>
|
||||
<data name="VDIMigrateDialog" xml:space="preserve">
|
||||
<value>vms-storage-move</value>
|
||||
</data>
|
||||
@ -1065,21 +1071,15 @@
|
||||
<data name="VMAppliancesDialog" xml:space="preserve">
|
||||
<value>vapps-manage</value>
|
||||
</data>
|
||||
<data name="VmSnapshotDialog" xml:space="preserve">
|
||||
<value>vms-snapshots-take</value>
|
||||
</data>
|
||||
<data name="VMSnapshotPage" xml:space="preserve">
|
||||
<value>vms-snapshots-newtemplate</value>
|
||||
</data>
|
||||
<data name="VMSnapshotSchedulesDialog" xml:space="preserve">
|
||||
<value>vms-snapshotschedule-about</value>
|
||||
</data>
|
||||
<data name="VcpuWarningDialog" xml:space="preserve">
|
||||
<value>vms-properties</value>
|
||||
</data>
|
||||
<data name="VmSnapshotDialog" xml:space="preserve">
|
||||
<value>vms-snapshots-take</value>
|
||||
</data>
|
||||
<data name="WLBReports" xml:space="preserve">
|
||||
<value>wlb-reports-creating</value>
|
||||
</data>
|
||||
<data name="WarningVmDisableChangedBlockTracking" xml:space="preserve">
|
||||
<value>cbt-overview</value>
|
||||
</data>
|
||||
@ -1107,6 +1107,9 @@
|
||||
<data name="WlbEditScheduledTask" xml:space="preserve">
|
||||
<value>wlb-placement-strategy-change</value>
|
||||
</data>
|
||||
<data name="WLBReports" xml:space="preserve">
|
||||
<value>wlb-reports-creating</value>
|
||||
</data>
|
||||
<data name="WlbReportSubscriptionDialog" xml:space="preserve">
|
||||
<value>wlb-reports-creating</value>
|
||||
</data>
|
||||
|
@ -971,6 +971,7 @@ namespace XenAdmin
|
||||
|
||||
Updates.CheckServerPatches();
|
||||
Updates.CheckServerVersion();
|
||||
Updates.CheckHotfixEligibility(connection);
|
||||
|
||||
HealthCheck.SendMetadataToHealthCheck();
|
||||
RequestRefreshTreeView();
|
||||
@ -1124,6 +1125,7 @@ namespace XenAdmin
|
||||
case "license_params":
|
||||
UpdateHeader();
|
||||
UpdateToolbars();
|
||||
Updates.CheckHotfixEligibility(host.Connection);
|
||||
break;
|
||||
case "other_config":
|
||||
// other_config may contain HideFromXenCenter
|
||||
|
1
XenAdmin/TabPages/AlertSummaryPage.Designer.cs
generated
1
XenAdmin/TabPages/AlertSummaryPage.Designer.cs
generated
@ -16,6 +16,7 @@ namespace XenAdmin.TabPages
|
||||
if (disposing)
|
||||
{
|
||||
DeregisterEventHandlers();
|
||||
DeregisterCheckForUpdatesEvents();
|
||||
|
||||
if (components != null)
|
||||
components.Dispose();
|
||||
|
@ -69,6 +69,7 @@ namespace XenAdmin.TabPages
|
||||
UpdateActionEnablement();
|
||||
|
||||
m_alertCollectionChangedWithInvoke = Program.ProgramInvokeHandler(AlertsCollectionChanged);
|
||||
RegisterCheckForUpdatesEvents();
|
||||
|
||||
toolStripSplitButtonDismiss.DefaultItem = tsmiDismissAll;
|
||||
toolStripSplitButtonDismiss.Text = tsmiDismissAll.Text;
|
||||
@ -600,6 +601,7 @@ namespace XenAdmin.TabPages
|
||||
switch (e.Action)
|
||||
{
|
||||
case CollectionChangeAction.Add:
|
||||
case CollectionChangeAction.Refresh:
|
||||
Rebuild(); // rebuild entire alert list to ensure filtering and sorting
|
||||
break;
|
||||
case CollectionChangeAction.Remove:
|
||||
@ -833,5 +835,22 @@ namespace XenAdmin.TabPages
|
||||
|
||||
Clip.SetClipboardText(alert.GetUpdateDetailsCSVQuotes());
|
||||
}
|
||||
|
||||
#region CheckForUpdates events
|
||||
private void RegisterCheckForUpdatesEvents()
|
||||
{
|
||||
Updates.CheckForUpdatesCompleted += CheckForUpdatesCompleted;
|
||||
}
|
||||
|
||||
private void DeregisterCheckForUpdatesEvents()
|
||||
{
|
||||
Updates.CheckForUpdatesCompleted -= CheckForUpdatesCompleted;
|
||||
}
|
||||
|
||||
private void CheckForUpdatesCompleted(bool succeeded, string errorMessage)
|
||||
{
|
||||
Updates.CheckHotfixEligibility();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -1084,7 +1084,15 @@ namespace XenAdmin.TabPages
|
||||
if (!Helpers.ElyOrGreater(host) && host.software_version.ContainsKey("build_number"))
|
||||
pdSectionVersion.AddEntry(Messages.SOFTWARE_VERSION_BUILD_NUMBER, host.software_version["build_number"]);
|
||||
if (host.software_version.ContainsKey("product_version"))
|
||||
pdSectionVersion.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION, host.ProductVersionText());
|
||||
{
|
||||
var hotfixEligibilityString = AdditionalVersionString(host);
|
||||
if (string.IsNullOrEmpty(hotfixEligibilityString))
|
||||
pdSectionVersion.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION, host.ProductVersionText());
|
||||
else
|
||||
pdSectionVersion.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION,
|
||||
string.Format(Messages.MAINWINDOW_CONTEXT_REASON, host.ProductVersionText(), hotfixEligibilityString),
|
||||
Color.Red);
|
||||
}
|
||||
if (host.software_version.ContainsKey("dbv"))
|
||||
pdSectionVersion.AddEntry("DBV", host.software_version["dbv"]);
|
||||
}
|
||||
@ -1329,7 +1337,13 @@ namespace XenAdmin.TabPages
|
||||
{
|
||||
if (p.IsPoolFullyUpgraded())
|
||||
{
|
||||
s.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION, master.ProductVersionText());
|
||||
var hotfixEligibilityString = AdditionalVersionString(master);
|
||||
if (string.IsNullOrEmpty(hotfixEligibilityString))
|
||||
s.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION, master.ProductVersionText());
|
||||
else
|
||||
s.AddEntry(Messages.SOFTWARE_VERSION_PRODUCT_VERSION,
|
||||
string.Format(Messages.MAINWINDOW_CONTEXT_REASON, master.ProductVersionText(), hotfixEligibilityString),
|
||||
Color.Red);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1380,6 +1394,42 @@ namespace XenAdmin.TabPages
|
||||
}
|
||||
}
|
||||
|
||||
private string AdditionalVersionString(Host host)
|
||||
{
|
||||
var hotfixEligibility = Updates.HotfixEligibility(host, out var xenServerVersion);
|
||||
var unlicensed = host.IsFreeLicenseOrExpired();
|
||||
|
||||
switch (hotfixEligibility)
|
||||
{
|
||||
// premium
|
||||
case hotfix_eligibility.premium when unlicensed && xenServerVersion.HotfixEligibilityPremiumDate != DateTime.MinValue:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_FREE, HelpersGUI.DateTimeToString(xenServerVersion.HotfixEligibilityPremiumDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
|
||||
case hotfix_eligibility.premium when unlicensed:
|
||||
return Messages.HOTFIX_ELIGIBILITY_WARNING_FREE_NO_DATE;
|
||||
|
||||
// cu
|
||||
case hotfix_eligibility.cu when unlicensed && xenServerVersion.HotfixEligibilityPremiumDate != DateTime.MinValue:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_FREE, HelpersGUI.DateTimeToString(xenServerVersion.HotfixEligibilityPremiumDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
|
||||
case hotfix_eligibility.cu when unlicensed:
|
||||
return Messages.HOTFIX_ELIGIBILITY_WARNING_FREE_NO_DATE;
|
||||
|
||||
case hotfix_eligibility.cu when xenServerVersion.HotfixEligibilityNoneDate != DateTime.MinValue:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_CU, HelpersGUI.DateTimeToString(xenServerVersion.HotfixEligibilityNoneDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
|
||||
case hotfix_eligibility.cu:
|
||||
return Messages.HOTFIX_ELIGIBILITY_WARNING_CU_NO_DATE;
|
||||
|
||||
// none
|
||||
case hotfix_eligibility.none when xenServerVersion.EolDate != DateTime.MinValue:
|
||||
return string.Format(Messages.HOTFIX_ELIGIBILITY_WARNING_EOL, HelpersGUI.DateTimeToString(xenServerVersion.EolDate.ToLocalTime(), Messages.DATEFORMAT_DMY, true));
|
||||
case hotfix_eligibility.none:
|
||||
return Messages.HOTFIX_ELIGIBILITY_WARNING_EOL_NO_DATE;
|
||||
|
||||
// default
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private static void GenerateVirtualisationStatusForGeneralBox(PDSection s, VM vm)
|
||||
{
|
||||
if (vm != null && vm.Connection != null)
|
||||
|
@ -100,6 +100,7 @@
|
||||
<Compile Include="Actions\GUIActions\SearchAction.cs" />
|
||||
<Compile Include="Alerts\NewVersionPriorityAlertComparer.cs" />
|
||||
<Compile Include="Alerts\Types\AlarmMessageAlert.cs" />
|
||||
<Compile Include="Alerts\Types\HotfixEligibilityAlert.cs" />
|
||||
<Compile Include="Alerts\Types\XenServerUpdateAlert.cs" />
|
||||
<Compile Include="Alerts\Types\DuplicateIqnAlert.cs" />
|
||||
<Compile Include="Alerts\Types\MissingIqnAlert.cs" />
|
||||
|
@ -54,7 +54,7 @@ namespace XenAdminTests.UnitTests.AlertTests
|
||||
[Test]
|
||||
public void TestAlertWithConnectionAndHosts()
|
||||
{
|
||||
XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, false, "http://url", new List<XenServerPatch>(), new List<XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123", "", false, "");
|
||||
XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, false, "http://url", new List<XenServerPatch>(), new List<XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123", "", false, "", "", "", "", "");
|
||||
var alert = new XenServerVersionAlert(ver);
|
||||
alert.IncludeConnection(connA.Object);
|
||||
alert.IncludeConnection(connB.Object);
|
||||
@ -80,7 +80,7 @@ namespace XenAdminTests.UnitTests.AlertTests
|
||||
[Test]
|
||||
public void TestAlertWithHostsAndNoConnection()
|
||||
{
|
||||
XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, false, "http://url", new List<XenServerPatch>(), new List<XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123", "", false, "");
|
||||
XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, false, "http://url", new List<XenServerPatch>(), new List<XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123", "", false, "", "", "", "", "");
|
||||
var alert = new XenServerVersionAlert(ver);
|
||||
alert.IncludeHosts(new List<Host> { hostA.Object, hostB.Object });
|
||||
|
||||
@ -104,7 +104,7 @@ namespace XenAdminTests.UnitTests.AlertTests
|
||||
[Test]
|
||||
public void TestAlertWithConnectionAndNoHosts()
|
||||
{
|
||||
XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, false, "http://url", new List<XenServerPatch>(), new List<XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123", "", false, "");
|
||||
XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, false, "http://url", new List<XenServerPatch>(), new List<XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123", "", false, "", "", "", "", "");
|
||||
var alert = new XenServerVersionAlert(ver);
|
||||
alert.IncludeConnection(connA.Object);
|
||||
alert.IncludeConnection(connB.Object);
|
||||
@ -129,7 +129,7 @@ namespace XenAdminTests.UnitTests.AlertTests
|
||||
[Test]
|
||||
public void TestAlertWithNoConnectionAndNoHosts()
|
||||
{
|
||||
XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, false, "http://url", new List<XenServerPatch>(), new List<XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123", "", false, "");
|
||||
XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, false, "http://url", new List<XenServerPatch>(), new List<XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123", "", false, "", "", "", "", "");
|
||||
var alert = new XenServerVersionAlert(ver);
|
||||
|
||||
ClassVerifiers.VerifyGetters(alert, new AlertClassUnitTestData
|
||||
|
@ -252,6 +252,11 @@ namespace XenAdmin.Actions
|
||||
string patchUuid = "";
|
||||
bool presentAsUpdate = false;
|
||||
string minXcVersion = "";
|
||||
string hotfixEligibility = "";
|
||||
string hotfixEligibilityPremiumDate = "";
|
||||
string hotfixEligibilityNoneDate = "";
|
||||
string eolDate = "";
|
||||
|
||||
|
||||
foreach (XmlAttribute attrib in version.Attributes)
|
||||
{
|
||||
@ -275,6 +280,14 @@ namespace XenAdmin.Actions
|
||||
presentAsUpdate = attrib.Value.ToUpperInvariant() == bool.TrueString.ToUpperInvariant();
|
||||
else if (attrib.Name == "minimum-xc-version")
|
||||
minXcVersion = attrib.Value;
|
||||
else if (attrib.Name == "hotfix-eligibility")
|
||||
hotfixEligibility = attrib.Value;
|
||||
else if (attrib.Name == "hotfix-eligibility-premium-date")
|
||||
hotfixEligibilityPremiumDate = attrib.Value;
|
||||
else if (attrib.Name == "hotfix-eligibility-none-date")
|
||||
hotfixEligibilityNoneDate = attrib.Value;
|
||||
else if (attrib.Name == "eol-date")
|
||||
eolDate = attrib.Value;
|
||||
}
|
||||
|
||||
List<XenServerPatch> patches = new List<XenServerPatch>();
|
||||
@ -310,7 +323,7 @@ namespace XenAdmin.Actions
|
||||
}
|
||||
|
||||
XenServerVersions.Add(new XenServerVersion(version_oem, name, is_latest, is_latest_cr, url, patches, minimalPatches, timestamp,
|
||||
buildNumber, patchUuid, presentAsUpdate, minXcVersion));
|
||||
buildNumber, patchUuid, presentAsUpdate, minXcVersion, hotfixEligibility, hotfixEligibilityPremiumDate, hotfixEligibilityNoneDate, eolDate));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +47,10 @@ namespace XenAdmin.Core
|
||||
public string PatchUuid;
|
||||
public bool PresentAsUpdate;
|
||||
public Version MinimumXcVersion;
|
||||
public hotfix_eligibility HotfixEligibility;
|
||||
public DateTime HotfixEligibilityPremiumDate;
|
||||
public DateTime HotfixEligibilityNoneDate;
|
||||
public DateTime EolDate;
|
||||
|
||||
/// <summary>
|
||||
/// A host of this version is considered up-to-date when it has all the patches in this list installed on it
|
||||
@ -72,7 +76,8 @@ namespace XenAdmin.Core
|
||||
/// <param name="patchUuid"></param>
|
||||
/// <param name="presentAsUpdate">Indicates that the new version (usually a CU) should be presented as an update where possible</param>
|
||||
public XenServerVersion(string version_oem, string name, bool latest, bool latestCr, string url, List<XenServerPatch> patches, List<XenServerPatch> minimumPatches,
|
||||
string timestamp, string buildNumber, string patchUuid, bool presentAsUpdate, string minXcVersion)
|
||||
string timestamp, string buildNumber, string patchUuid, bool presentAsUpdate, string minXcVersion, string hotfixEligibility, string hotfixEligibilityPremiumDate,
|
||||
string hotfixEligibilityNoneDate, string eolDate)
|
||||
{
|
||||
ParseVersion(version_oem);
|
||||
Name = name;
|
||||
@ -86,6 +91,10 @@ namespace XenAdmin.Core
|
||||
PatchUuid = patchUuid;
|
||||
PresentAsUpdate = presentAsUpdate;
|
||||
ParseMinXcVersion(minXcVersion);
|
||||
Enum.TryParse(hotfixEligibility, out HotfixEligibility);
|
||||
DateTime.TryParse(hotfixEligibilityPremiumDate, out HotfixEligibilityPremiumDate);
|
||||
DateTime.TryParse(hotfixEligibilityNoneDate, out HotfixEligibilityNoneDate);
|
||||
DateTime.TryParse(eolDate, out EolDate);
|
||||
}
|
||||
|
||||
private void ParseVersion(string version_oem)
|
||||
@ -115,6 +124,25 @@ namespace XenAdmin.Core
|
||||
return !string.IsNullOrEmpty(PatchUuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum hotfix_eligibility
|
||||
{
|
||||
/// <summary>
|
||||
/// All customers are eligible for hotfixes.
|
||||
/// </summary>
|
||||
all,
|
||||
/// <summary>
|
||||
/// Only paying customers are eligible for hotfixes.
|
||||
/// </summary>
|
||||
premium,
|
||||
/// <summary>
|
||||
/// The only hotfix available is a Cumulative Update, for paying customers.
|
||||
/// </summary>
|
||||
cu,
|
||||
/// <summary>
|
||||
/// The version has reached EOL for all customers and no more hotfixes will be released.
|
||||
/// </summary>
|
||||
none
|
||||
}
|
||||
}
|
@ -61,6 +61,18 @@ namespace XenAdmin.Alerts
|
||||
log.Error("Failed to add incoming alert", e);
|
||||
}
|
||||
}
|
||||
public static void AddAlertRange(IEnumerable<Alert> collection)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (XenCenterAlertsLock)
|
||||
XenCenterAlerts.AddRange(collection);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.Error("Failed to add incoming alerts", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveAlert(Alert a)
|
||||
{
|
||||
@ -91,6 +103,21 @@ namespace XenAdmin.Alerts
|
||||
return XenCenterAlerts.Find(predicate);
|
||||
}
|
||||
|
||||
public static int FindAlertIndex(Predicate<Alert> predicate)
|
||||
{
|
||||
lock (XenCenterAlertsLock)
|
||||
return XenCenterAlerts.FindIndex(predicate);
|
||||
}
|
||||
|
||||
public static void RefreshAlertAt(int index)
|
||||
{
|
||||
lock (XenCenterAlertsLock)
|
||||
{
|
||||
if (index >= 0 && index < XenCenterAlerts.Count)
|
||||
XenCenterAlerts[index] = XenCenterAlerts[index]; // this will trigger the CollectionChanged event with CollectionChangeAction.Refresh
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// locks the list of alerts before taking a total, and then returning that value
|
||||
/// </summary>
|
||||
|
126
XenModel/Messages.Designer.cs
generated
126
XenModel/Messages.Designer.cs
generated
@ -18662,6 +18662,123 @@ namespace XenAdmin {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A new Cumulative Update is available for {0}. After {1} there will be no further hotfixes released for {2}. Please update to the latest Cumulative Update..
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_CU {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_CU", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} reached End of Life on {1}. There will be no further hotfixes released after this date. Please upgrade to the latest supported version..
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_EOL {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_EOL", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} reached End of Life on {1}. There will be no further hotfixes released after this date. Please upgrade to the latest CR..
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_EOL_FREE {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_EOL_FREE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} reached End of Life for express customers on {1}. You are no longer eligible for hotfixes released after this date. Please upgrade to the latest CR..
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_FREE {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_FREE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A new Cumulative Update is available.
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_ALERT_TITLE_CU {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_ALERT_TITLE_CU", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} has reached End of Life.
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_ALERT_TITLE_EOL {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_ALERT_TITLE_EOL", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} has reached End of Life for express customers.
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_ALERT_TITLE_FREE {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_ALERT_TITLE_FREE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No further hotfixes released after {0}.
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_WARNING_CU {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_WARNING_CU", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A new Cumulative Update is available.
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_WARNING_CU_NO_DATE {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_WARNING_CU_NO_DATE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to End of Life on {0}.
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_WARNING_EOL {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_WARNING_EOL", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to End of Life.
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_WARNING_EOL_NO_DATE {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_WARNING_EOL_NO_DATE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Not eligible for hotfixes released after {0}.
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_WARNING_FREE {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_WARNING_FREE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to End of Life for express customers.
|
||||
/// </summary>
|
||||
public static string HOTFIX_ELIGIBILITY_WARNING_FREE_NO_DATE {
|
||||
get {
|
||||
return ResourceManager.GetString("HOTFIX_ELIGIBILITY_WARNING_FREE_NO_DATE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Hourly; at {0} minutes past each hour.
|
||||
/// </summary>
|
||||
@ -40681,6 +40798,15 @@ namespace XenAdmin {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [Legacy XenServer product].
|
||||
/// </summary>
|
||||
public static string XENSERVER_LEGACY {
|
||||
get {
|
||||
return ResourceManager.GetString("XENSERVER_LEGACY", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [XenServer] Templates.
|
||||
/// </summary>
|
||||
|
@ -6524,6 +6524,45 @@ This might result in failure to migrate VMs to this server during the RPU or to
|
||||
<data name="HOTFIX_CHECK" xml:space="preserve">
|
||||
<value>Hotfix check</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_CU" xml:space="preserve">
|
||||
<value>A new Cumulative Update is available for {0}. After {1} there will be no further hotfixes released for {2}. Please update to the latest Cumulative Update.</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_EOL" xml:space="preserve">
|
||||
<value>{0} reached End of Life on {1}. There will be no further hotfixes released after this date. Please upgrade to the latest supported version.</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_EOL_FREE" xml:space="preserve">
|
||||
<value>{0} reached End of Life on {1}. There will be no further hotfixes released after this date. Please upgrade to the latest CR.</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_ALERT_DESCRIPTION_FREE" xml:space="preserve">
|
||||
<value>{0} reached End of Life for express customers on {1}. You are no longer eligible for hotfixes released after this date. Please upgrade to the latest CR.</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_ALERT_TITLE_CU" xml:space="preserve">
|
||||
<value>A new Cumulative Update is available</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_ALERT_TITLE_EOL" xml:space="preserve">
|
||||
<value>{0} has reached End of Life</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_ALERT_TITLE_FREE" xml:space="preserve">
|
||||
<value>{0} has reached End of Life for express customers</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_WARNING_CU" xml:space="preserve">
|
||||
<value>No further hotfixes released after {0}</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_WARNING_CU_NO_DATE" xml:space="preserve">
|
||||
<value>A new Cumulative Update is available</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_WARNING_EOL" xml:space="preserve">
|
||||
<value>End of Life on {0}</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_WARNING_EOL_NO_DATE" xml:space="preserve">
|
||||
<value>End of Life</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_WARNING_FREE" xml:space="preserve">
|
||||
<value>Not eligible for hotfixes released after {0}</value>
|
||||
</data>
|
||||
<data name="HOTFIX_ELIGIBILITY_WARNING_FREE_NO_DATE" xml:space="preserve">
|
||||
<value>End of Life for express customers</value>
|
||||
</data>
|
||||
<data name="HOURLY_SCHEDULE_FORMAT" xml:space="preserve">
|
||||
<value>Hourly; at {0} minutes past each hour</value>
|
||||
</data>
|
||||
@ -14032,6 +14071,9 @@ Are you sure you want to enable automated power management for this Host?</value
|
||||
<data name="XENSERVER_6_5" xml:space="preserve">
|
||||
<value>[XenServer] [BRANDING_VERSION_6_5]</value>
|
||||
</data>
|
||||
<data name="XENSERVER_LEGACY" xml:space="preserve">
|
||||
<value>[Legacy XenServer product]</value>
|
||||
</data>
|
||||
<data name="XENSERVER_TEMPLATES" xml:space="preserve">
|
||||
<value>[XenServer] Templates</value>
|
||||
</data>
|
||||
|
Loading…
Reference in New Issue
Block a user