use of com.xensource.xenapi.Types.UuidInvalid in project cloudstack by apache.
the class XcpServerDiscoverer method poolHasHotFix.
protected boolean poolHasHotFix(Connection conn, String hostIp, String hotFixUuid) {
try {
Map<Host, Host.Record> hosts = Host.getAllRecords(conn);
for (Map.Entry<Host, Host.Record> entry : hosts.entrySet()) {
Host.Record re = entry.getValue();
if (!re.address.equalsIgnoreCase(hostIp)) {
continue;
}
Set<HostPatch> patches = re.patches;
PoolPatch poolPatch = PoolPatch.getByUuid(conn, hotFixUuid);
for (HostPatch patch : patches) {
PoolPatch pp = patch.getPoolPatch(conn);
if (pp != null && pp.equals(poolPatch) && patch.getApplied(conn)) {
s_logger.debug("host " + hostIp + " does have " + hotFixUuid + " Hotfix.");
return true;
}
}
}
return false;
} catch (UuidInvalid e) {
s_logger.debug("host " + hostIp + " doesn't have " + hotFixUuid + " Hotfix");
} catch (Exception e) {
s_logger.debug("can't get patches information, consider it doesn't have " + hotFixUuid + " Hotfix");
}
return false;
}
Aggregations