mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-24 22:06:59 +01:00
CP-41737: Update CanRun
override logic in PoolHasDeprecatedSrsCheck
Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
This commit is contained in:
parent
727612b68b
commit
7fa8731c59
@ -46,13 +46,11 @@ namespace XenAdmin.Diagnostics.Checks
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CanRun() => !Helpers.Post82X(Host.Connection);
|
||||
public override bool CanRun() => Host.Connection.Cache.SRs.Any(sr => sr.GetSRType(true) == SR.SRTypes.lvmofcoe);
|
||||
|
||||
protected override Problem RunHostCheck()
|
||||
{
|
||||
var hasFCoESr = Host.Connection.Cache.SRs.Any(sr => sr.GetSRType(true) == SR.SRTypes.lvmofcoe);
|
||||
return !hasFCoESr ? null : new PoolHasFCoESrWarning(this, Helpers.GetPoolOfOne(Host.Connection), true);
|
||||
return new PoolHasFCoESrWarning(this, Helpers.GetPoolOfOne(Host.Connection));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -43,19 +43,15 @@ namespace XenAdmin.Diagnostics.Problems.PoolProblem
|
||||
internal class PoolHasFCoESrWarning : WarningWithMoreInfo
|
||||
{
|
||||
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod()?.DeclaringType);
|
||||
|
||||
private readonly bool _hasFCoESr;
|
||||
|
||||
private readonly Pool _pool;
|
||||
|
||||
public override string HelpMessage => "Details...";
|
||||
public override string Message => string.Empty;
|
||||
public override string Title => string.Empty;
|
||||
public override string Description => _hasFCoESr ? string.Format(Messages.POOL_HAS_DEPRECATED_FCOE_WARNING, _pool) : null;
|
||||
public override string Description => string.Format(Messages.POOL_HAS_DEPRECATED_FCOE_WARNING, _pool);
|
||||
|
||||
public PoolHasFCoESrWarning(Check check, Pool pool, bool hasFCoESr) : base(check)
|
||||
public PoolHasFCoESrWarning(Check check, Pool pool) : base(check)
|
||||
{
|
||||
_hasFCoESr = hasFCoESr;
|
||||
_pool = pool;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user