mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-12-25 03:39:52 +01:00
Merge pull request #1512 from GaborApatiNagy/REQ-411_2
CP-21504: Updates wizard: Automated mode for new versions that are available as updates
This commit is contained in:
commit
d2eda25f40
@ -568,6 +568,46 @@ namespace XenAdmin.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static UpgradeSequence GetUpgradeSequence(IXenConnection conn, XenServerPatchAlert alert)
|
||||||
|
{
|
||||||
|
var uSeq = new UpgradeSequence();
|
||||||
|
|
||||||
|
if (XenServerVersions == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
Host master = Helpers.GetMaster(conn);
|
||||||
|
if (master == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var version = GetCommonServerVersionOfHostsInAConnection(conn, XenServerVersions);
|
||||||
|
|
||||||
|
if (version != null)
|
||||||
|
{
|
||||||
|
//if it's a version updgrade the min sequence will be this patch (the upgrade) and the min patches for the new version
|
||||||
|
if (alert.NewServerVersion != null)
|
||||||
|
{
|
||||||
|
if (alert.NewServerVersion.MinimalPatches == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
uSeq.MinimalPatches = new List<XenServerPatch>();
|
||||||
|
uSeq.MinimalPatches.Add(alert.Patch);
|
||||||
|
uSeq.MinimalPatches.AddRange(alert.NewServerVersion.MinimalPatches);
|
||||||
|
|
||||||
|
List<Host> hosts = conn.Cache.Hosts.ToList();
|
||||||
|
|
||||||
|
foreach (Host h in hosts)
|
||||||
|
{
|
||||||
|
uSeq[h] = GetUpgradeSequenceForHost(h, uSeq.MinimalPatches);
|
||||||
|
}
|
||||||
|
|
||||||
|
return uSeq;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a XenServerVersion if all hosts of the pool have the same version
|
/// Returns a XenServerVersion if all hosts of the pool have the same version
|
||||||
/// Returns null if it is unknown or they don't match
|
/// Returns null if it is unknown or they don't match
|
||||||
|
Loading…
Reference in New Issue
Block a user