CA-292991: Remove unused modules and check clusterHostPif not null

Signed-off-by: serenc <seren.corbett@citrix.com>
This commit is contained in:
serenc 2018-07-12 14:56:17 +01:00 committed by Mihaela Stoica
parent dc833d2cc8
commit e1cb27a80d

View File

@ -34,8 +34,6 @@ using System.Collections.Generic;
using XenAdmin.Network;
using XenAPI;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using XenAdmin.Actions;
namespace XenAdmin.Core
{
@ -690,15 +688,17 @@ namespace XenAdmin.Core
public static bool HasIpForClusterNetwork(IXenConnection masterConnection, Host slaveHost, out bool clusterHostInBond)
{
clusterHostInBond = false;
var clusterHost = masterConnection.Cache.Cluster_hosts.FirstOrDefault();
if (clusterHost == null)
{
clusterHostInBond = false;
return true;
}
var clusterHostPif = clusterHost.Connection.Resolve(clusterHost.PIF);
if (clusterHostPif == null)
return true;
clusterHostInBond = clusterHostPif.IsBondNIC();
var pifsWithIPAddress = 0;