diff --git a/core/src/com/cloud/host/dao/HostDao.java b/core/src/com/cloud/host/dao/HostDao.java index 7f0258aa74e..a803e1c1f3f 100644 --- a/core/src/com/cloud/host/dao/HostDao.java +++ b/core/src/com/cloud/host/dao/HostDao.java @@ -111,7 +111,7 @@ public interface HostDao extends GenericDao { * @param type * @return */ - List listByType(Type type, boolean routingCapable); + List listByType(Type type); /** * Find hosts that have not responded to a ping regardless of state @@ -137,9 +137,5 @@ public interface HostDao extends GenericDao { void loadDetails(HostVO host); - HostVO findConsoleProxyHost(String name, Type type); - - List listAllConsoleProxyHosts(Type type); - - + HostVO findConsoleProxyHost(String name, Type type); } diff --git a/core/src/com/cloud/host/dao/HostDaoImpl.java b/core/src/com/cloud/host/dao/HostDaoImpl.java index 952cfc500e5..b4d49edb195 100644 --- a/core/src/com/cloud/host/dao/HostDaoImpl.java +++ b/core/src/com/cloud/host/dao/HostDaoImpl.java @@ -80,7 +80,6 @@ public class HostDaoImpl extends GenericDaoBase implements HostDao protected final SearchBuilder MaintenanceCountSearch; protected final SearchBuilder ClusterSearch; protected final SearchBuilder ConsoleProxyHostSearch; - protected final SearchBuilder ConsoleProxyHostsListSearch; protected final Attribute _statusAttr; protected final Attribute _msIdAttr; @@ -161,10 +160,6 @@ public class HostDaoImpl extends GenericDaoBase implements HostDao ConsoleProxyHostSearch.and("name", ConsoleProxyHostSearch.entity().getName(), SearchCriteria.Op.EQ); ConsoleProxyHostSearch.and("type", ConsoleProxyHostSearch.entity().getType(), SearchCriteria.Op.EQ); ConsoleProxyHostSearch.done(); - - ConsoleProxyHostsListSearch = createSearchBuilder(); - ConsoleProxyHostsListSearch.and("type", ConsoleProxyHostsListSearch.entity().getType(), SearchCriteria.Op.EQ); - ConsoleProxyHostsListSearch.done(); PodSearch = createSearchBuilder(); PodSearch.and("pod", PodSearch.entity().getPodId(), SearchCriteria.Op.EQ); @@ -466,13 +461,6 @@ public class HostDaoImpl extends GenericDaoBase implements HostDao else return hostList.get(0); } - - @Override - public List listAllConsoleProxyHosts(Type type) { - SearchCriteria sc = ConsoleProxyHostSearch.create(); - sc.setParameters("type", type); - return listBy(sc); - } public List listByHostPod(long podId) { SearchCriteria sc = PodSearch.create("pod", podId); @@ -496,15 +484,10 @@ public class HostDaoImpl extends GenericDaoBase implements HostDao } @Override - public List listByType(Type type, boolean routingCapable) { + public List listByType(Type type) { SearchCriteria sc = TypeSearch.create(); sc.setParameters("type", type.toString()); - - if (routingCapable) { - sc.addAnd("routing_capbable", SearchCriteria.Op.EQ, Integer.valueOf(1)); - } - - return listIncludingRemovedBy(sc); + return listBy(sc); } protected void saveDetails(HostVO host) { diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 1c2bc1f5ba1..db2b6ad6395 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -5881,9 +5881,12 @@ public class ManagementServerImpl implements ManagementServer { //get a list of all Console proxies from the cp table List cpList = _consoleProxyDao.listAll(); //get a list of all hosts in host table for type cp - List cpHosts = _hostDao.listAllConsoleProxyHosts(com.cloud.host.Host.Type.ConsoleProxy); + List cpHosts = _hostDao.listByType(com.cloud.host.Host.Type.ConsoleProxy); //create a hashmap for fast lookup Map hostNameToHostIdMap = new HashMap(); + //updated console proxies list + List updatedCpList = new ArrayList(); + for(HostVO cpHost : cpHosts){ hostNameToHostIdMap.put(cpHost.getName(), cpHost.getId()); } @@ -5903,9 +5906,9 @@ public class ManagementServerImpl implements ManagementServer { //when cp reboots, the context will be reinit with the new cert } } catch (AgentUnavailableException e) { - s_logger.warn("Unable to send update certificate command to the console proxy resource", e); + s_logger.warn("Unable to send update certificate command to the console proxy resource as agent is unavailable", e); } catch (OperationTimedoutException e) { - s_logger.warn("Unable to send update certificate command to the console proxy resource", e); + s_logger.warn("Unable to send update certificate command to the console proxy resource as there was a timeout", e); } } return true;