Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of obsolete code (resolves CA-375774). #3253

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions XenAdmin/Diagnostics/Checks/CertificateKeyLengthCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
*/

using System;
using XenAdmin.Core;
using XenAPI;
using XenAdmin.Diagnostics.Problems;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAPI;

namespace XenAdmin.Diagnostics.Checks
{
Expand All @@ -62,8 +62,7 @@ protected override Problem RunHostCheck()

if (!_manualUpgrade)
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);
}

Expand Down
61 changes: 30 additions & 31 deletions XenAdmin/Diagnostics/Checks/HostHasHotfixCheck.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
/* Copyright (c) Cloud Software Group, Inc.
*
* 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
/* Copyright (c) Cloud Software Group, Inc.
*
* 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.Hotfixing;
using XenAdmin.Actions.Updates;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAPI;
Expand All @@ -45,9 +45,8 @@ public HostHasHotfixCheck(Host host)

protected override Problem RunHostCheck()
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfix(this, Host);
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfix(this, Host, hotfix);

return null;
}
Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/Diagnostics/Checks/HostMemoryPostUpgradeCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

using System;
using System.Collections.Generic;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAPI;
Expand All @@ -54,8 +54,7 @@ public HostMemoryPostUpgradeCheck(Host host, Dictionary<string, string> installM

protected override Problem RunHostCheck()
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);

if (TryGetDom0MemoryPostUpgrade(out var dom0MemoryPostUpgrade))
Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/Diagnostics/Checks/PVGuestsCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
using System;
using System.Linq;
using System.Collections.Generic;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.PoolProblem;
using XenAdmin.Diagnostics.Problems.HostProblem;
Expand Down Expand Up @@ -97,8 +97,7 @@ protected override Problem RunHostCheck()

if (!_manualUpgrade)
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);
}

Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/Diagnostics/Checks/PoolContainerManagementCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

using System;
using System.Collections.Generic;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAdmin.Diagnostics.Problems.PoolProblem;
Expand Down Expand Up @@ -85,8 +85,7 @@ protected override Problem RunHostCheck()

if (!_manualUpgrade)
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);
}

Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/Diagnostics/Checks/PoolHasDeprecatedSrsCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

using System.Collections.Generic;
using System.Linq;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAdmin.Diagnostics.Problems.PoolProblem;
Expand Down Expand Up @@ -59,8 +59,7 @@ protected override Problem RunHostCheck()
{
if (!_manualUpgrade)
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);
}

Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/Diagnostics/Checks/PoolLegacySslCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

using System;
using System.Collections.Generic;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAdmin.Diagnostics.Problems.PoolProblem;
Expand Down Expand Up @@ -94,8 +94,7 @@ protected override Problem RunHostCheck()

if (!_manualUpgrade)
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);
}

Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/Diagnostics/Checks/PowerOniLoCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

using System;
using System.Collections.Generic;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAPI;
Expand Down Expand Up @@ -89,8 +89,7 @@ protected override Problem RunHostCheck()

if (!_manualUpgrade)
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);
}

Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/Diagnostics/Checks/PrepareToUpgradeCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

using System;
using System.Collections.Generic;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Actions.Updates;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAPI;
Expand All @@ -54,8 +54,7 @@ public PrepareToUpgradeCheck(Host host, Dictionary<string, string> installMethod

protected override Problem RunHostCheck()
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);

try
Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/Diagnostics/Checks/SafeToUpgradeCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

using System;
using System.Collections.Generic;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAPI;
Expand All @@ -54,8 +54,7 @@ public SafeToUpgradeCheck(Host host, Dictionary<string, string> installMethodCon

protected override Problem RunHostCheck()
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);

try
Expand Down
7 changes: 3 additions & 4 deletions XenAdmin/Diagnostics/Checks/UpgradeRequiresEUA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAPI;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.UtilityProblem;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAPI;

namespace XenAdmin.Diagnostics.Checks
{
Expand Down Expand Up @@ -103,8 +103,7 @@ protected override Problem RunCheck()

foreach (var host in Hosts)
{
var hotfix = HotfixFactory.Hotfix(host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(host))
if (RpuHotfix.Exists(host, out var hotfix) && hotfix.ShouldBeAppliedTo(host))
return new HostDoesNotHaveHotfixWarning(this, host);
}

Expand Down
5 changes: 2 additions & 3 deletions XenAdmin/Diagnostics/Checks/VSwitchControllerCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

using System;
using System.Collections.Generic;
using XenAdmin.Actions.Updates;
using XenAdmin.Core;
using XenAdmin.Diagnostics.Hotfixing;
using XenAdmin.Diagnostics.Problems;
using XenAdmin.Diagnostics.Problems.HostProblem;
using XenAdmin.Diagnostics.Problems.PoolProblem;
Expand Down Expand Up @@ -91,8 +91,7 @@ protected override Problem RunHostCheck()

if (!_manualUpgrade)
{
var hotfix = HotfixFactory.Hotfix(Host);
if (hotfix != null && hotfix.ShouldBeAppliedTo(Host))
if (RpuHotfix.Exists(Host, out var hotfix) && hotfix.ShouldBeAppliedTo(Host))
return new HostDoesNotHaveHotfixWarning(this, Host);
}

Expand Down
70 changes: 0 additions & 70 deletions XenAdmin/Diagnostics/Hotfixing/HotfixFactory.cs

This file was deleted.

Loading
Loading