Merge pull request #1284 from GaborApatiNagy/master_errormessages

CA-227719: XenCenter to use new pre-check error messages
This commit is contained in:
Mihaela Stoica 2016-11-11 17:05:41 +00:00 committed by GitHub
commit 244b4059b5
7 changed files with 185 additions and 2 deletions

View File

@ -237,6 +237,15 @@ namespace XenAdmin.Diagnostics.Checks
switch (errorcode)
{
case "UPDATE_PRECHECK_FAILED_WRONG_SERVER_VERSION":
return new WrongServerVersion(this, Host);
case "UPDATE_PRECHECK_FAILED_CONFLICT_PRESENT":
return new ConflictingUpdatePresent(this, found, Host);
case "UPDATE_PRECHECK_FAILED_PREREQUISITE_MISSING":
return new PrerequisiteUpdateMissing(this, found, Host);
case "PATCH_PRECHECK_FAILED_WRONG_SERVER_VERSION":
return new WrongServerVersion(this, required, Host);

View File

@ -0,0 +1,61 @@
/* 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 XenAdmin.Diagnostics.Checks;
using XenAPI;
using System.Collections.Generic;
namespace XenAdmin.Diagnostics.Problems.HostProblem
{
public class ConflictingUpdatePresent : HostProblem
{
private readonly string confilctedUpdates;
public ConflictingUpdatePresent(Check check, string confilctedUpdates, Host host)
: base(check, host)
{
this.confilctedUpdates = confilctedUpdates;
}
public override string Description
{
get
{
return string.Format(Messages.UPDATES_WIZARD_PRECHECK_FAILED_CONFLICTING_UPDATE, confilctedUpdates);
}
}
public override string HelpMessage
{
get { return string.Empty; }
}
}
}

View File

@ -0,0 +1,62 @@
/* 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 XenAdmin.Diagnostics.Checks;
using XenAPI;
using System.Collections.Generic;
namespace XenAdmin.Diagnostics.Problems.HostProblem
{
public class PrerequisiteUpdateMissing : HostProblem
{
private readonly string requiredUpdates;
public PrerequisiteUpdateMissing(Check check, string requiredUpdates, Host host)
: base(check, host)
{
this.requiredUpdates = requiredUpdates;
}
public override string Description
{
get
{
return string.Format(Messages.UPDATES_WIZARD_PRECHECK_FAILED_REQUIRED_UPDATE_MISSING, requiredUpdates);
}
}
public override string HelpMessage
{
get { return string.Empty; }
}
}
}

View File

@ -39,15 +39,28 @@ namespace XenAdmin.Diagnostics.Problems.HostProblem
{
private readonly string _versionRequired;
public WrongServerVersion(Check check, string versionRequired,Host host)
public WrongServerVersion(Check check, string versionRequired, Host host)
: base(check, host)
{
_versionRequired = versionRequired;
}
public WrongServerVersion(Check check, Host host)
: base(check, host)
{
}
public override string Description
{
get { return string.Format(Messages.PATCH_FOR_XENSERVER_VERSION, _versionRequired); }
get
{
if (!string.IsNullOrEmpty(_versionRequired))
{
return string.Format(Messages.PATCH_FOR_XENSERVER_VERSION, _versionRequired);
}
return Messages.UPDATE_FOR_DIFFERENT_XENSERVER_VERSION;
}
}
public override string HelpMessage

View File

@ -225,9 +225,11 @@
<Compile Include="Diagnostics\Checks\HostNeedsRebootCheck.cs" />
<Compile Include="Diagnostics\Checks\SafeToUpgradeCheck.cs" />
<Compile Include="Diagnostics\Checks\HostHasUnsupportedStorageLinkSRCheck.cs" />
<Compile Include="Diagnostics\Problems\HostProblem\PrerequisiteUpdateMissing.cs" />
<Compile Include="Diagnostics\Problems\HostProblem\HostNeedsReboot.cs" />
<Compile Include="Diagnostics\Problems\HostProblem\HostNotSafeToUpgradeWarning.cs" />
<Compile Include="Diagnostics\Problems\HostProblem\HostOutOfSpaceProblem.cs" />
<Compile Include="Diagnostics\Problems\HostProblem\ConflictingUpdatePresent.cs" />
<Compile Include="Diagnostics\Problems\Information.cs" />
<Compile Include="Diagnostics\Problems\PoolProblem\CPUIncompatibilityProblem.cs" />
<Compile Include="Diagnostics\Problems\ProblemWithInformationUrl.cs" />

View File

@ -33084,6 +33084,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to This update is not compatible with this server version..
/// </summary>
public static string UPDATE_FOR_DIFFERENT_XENSERVER_VERSION {
get {
return ResourceManager.GetString("UPDATE_FOR_DIFFERENT_XENSERVER_VERSION", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cannot remove an update which is applied to any servers..
/// </summary>
@ -33827,6 +33836,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Conflicting update(s) are present: {0}.
/// </summary>
public static string UPDATES_WIZARD_PRECHECK_FAILED_CONFLICTING_UPDATE {
get {
return ResourceManager.GetString("UPDATES_WIZARD_PRECHECK_FAILED_CONFLICTING_UPDATE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pre-update checks failed on the selected servers. The update will not be applied..
/// </summary>
@ -33836,6 +33854,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Prerequisite update(s) are missing: {0}.
/// </summary>
public static string UPDATES_WIZARD_PRECHECK_FAILED_REQUIRED_UPDATE_MISSING {
get {
return ResourceManager.GetString("UPDATES_WIZARD_PRECHECK_FAILED_REQUIRED_UPDATE_MISSING", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Update precheck failed on server &apos;{0}&apos;.
/// </summary>

View File

@ -11759,6 +11759,9 @@ Note that if RBAC is enabled, only updates which you have privileges to dismiss
<data name="UPDATE_EXPORT_ALL_OR_FILTERED" xml:space="preserve">
<value>You have applied filters to the list of updates. Do you wish to export all updates from every connected server, or only the updates you have chosen to view?</value>
</data>
<data name="UPDATE_FOR_DIFFERENT_XENSERVER_VERSION" xml:space="preserve">
<value>This update is not compatible with this server version.</value>
</data>
<data name="UPDATE_MANAGER_CANNOT_REMOVE_APPLIED_PATCH" xml:space="preserve">
<value>Cannot remove an update which is applied to any servers.</value>
</data>
@ -13375,4 +13378,10 @@ You will need to navigate to the Console on each of the selected VMs to complete
<data name="UPDATE_ERROR_INTRODUCE" xml:space="preserve">
<value>Failed to introduce the update.</value>
</data>
<data name="UPDATES_WIZARD_PRECHECK_FAILED_CONFLICTING_UPDATE" xml:space="preserve">
<value>Conflicting update(s) are present: {0}</value>
</data>
<data name="UPDATES_WIZARD_PRECHECK_FAILED_REQUIRED_UPDATE_MISSING" xml:space="preserve">
<value>Prerequisite update(s) are missing: {0}</value>
</data>
</root>