Skip to content

Commit 9c80911

Browse files
author
abhishek
committed
more changes
1 parent d9ebb71 commit 9c80911

3 files changed

Lines changed: 10 additions & 28 deletions

File tree

‎core/src/com/cloud/host/dao/HostDao.java‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public interface HostDao extends GenericDao<HostVO, Long> {
111111
* @param type
112112
* @return
113113
*/
114-
List<HostVO> listByType(Type type, boolean routingCapable);
114+
List<HostVO> listByType(Type type);
115115

116116
/**
117117
* Find hosts that have not responded to a ping regardless of state
@@ -137,9 +137,5 @@ public interface HostDao extends GenericDao<HostVO, Long> {
137137

138138
void loadDetails(HostVO host);
139139

140-
HostVO findConsoleProxyHost(String name, Type type);
141-
142-
List<HostVO> listAllConsoleProxyHosts(Type type);
143-
144-
140+
HostVO findConsoleProxyHost(String name, Type type);
145141
}

‎core/src/com/cloud/host/dao/HostDaoImpl.java‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
8080
protected final SearchBuilder<HostVO> MaintenanceCountSearch;
8181
protected final SearchBuilder<HostVO> ClusterSearch;
8282
protected final SearchBuilder<HostVO> ConsoleProxyHostSearch;
83-
protected final SearchBuilder<HostVO> ConsoleProxyHostsListSearch;
8483

8584
protected final Attribute _statusAttr;
8685
protected final Attribute _msIdAttr;
@@ -161,10 +160,6 @@ public HostDaoImpl() {
161160
ConsoleProxyHostSearch.and("name", ConsoleProxyHostSearch.entity().getName(), SearchCriteria.Op.EQ);
162161
ConsoleProxyHostSearch.and("type", ConsoleProxyHostSearch.entity().getType(), SearchCriteria.Op.EQ);
163162
ConsoleProxyHostSearch.done();
164-
165-
ConsoleProxyHostsListSearch = createSearchBuilder();
166-
ConsoleProxyHostsListSearch.and("type", ConsoleProxyHostsListSearch.entity().getType(), SearchCriteria.Op.EQ);
167-
ConsoleProxyHostsListSearch.done();
168163

169164
PodSearch = createSearchBuilder();
170165
PodSearch.and("pod", PodSearch.entity().getPodId(), SearchCriteria.Op.EQ);
@@ -466,13 +461,6 @@ public HostVO findConsoleProxyHost(String name, Type type) {
466461
else
467462
return hostList.get(0);
468463
}
469-
470-
@Override
471-
public List<HostVO> listAllConsoleProxyHosts(Type type) {
472-
SearchCriteria<HostVO> sc = ConsoleProxyHostSearch.create();
473-
sc.setParameters("type", type);
474-
return listBy(sc);
475-
}
476464

477465
public List<HostVO> listByHostPod(long podId) {
478466
SearchCriteria<HostVO> sc = PodSearch.create("pod", podId);
@@ -496,15 +484,10 @@ public List<HostVO> listByTypeDataCenter(Type type, long dcId) {
496484
}
497485

498486
@Override
499-
public List<HostVO> listByType(Type type, boolean routingCapable) {
487+
public List<HostVO> listByType(Type type) {
500488
SearchCriteria<HostVO> sc = TypeSearch.create();
501489
sc.setParameters("type", type.toString());
502-
503-
if (routingCapable) {
504-
sc.addAnd("routing_capbable", SearchCriteria.Op.EQ, Integer.valueOf(1));
505-
}
506-
507-
return listIncludingRemovedBy(sc);
490+
return listBy(sc);
508491
}
509492

510493
protected void saveDetails(HostVO host) {

‎server/src/com/cloud/server/ManagementServerImpl.java‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5881,9 +5881,12 @@ public boolean uploadCertificate(UploadCustomCertificateCmd cmd) throws Resource
58815881
//get a list of all Console proxies from the cp table
58825882
List<ConsoleProxyVO> cpList = _consoleProxyDao.listAll();
58835883
//get a list of all hosts in host table for type cp
5884-
List<HostVO> cpHosts = _hostDao.listAllConsoleProxyHosts(com.cloud.host.Host.Type.ConsoleProxy);
5884+
List<HostVO> cpHosts = _hostDao.listByType(com.cloud.host.Host.Type.ConsoleProxy);
58855885
//create a hashmap for fast lookup
58865886
Map<String,Long> hostNameToHostIdMap = new HashMap<String, Long>();
5887+
//updated console proxies list
5888+
List<ConsoleProxyVO> updatedCpList = new ArrayList<ConsoleProxyVO>();
5889+
58875890
for(HostVO cpHost : cpHosts){
58885891
hostNameToHostIdMap.put(cpHost.getName(), cpHost.getId());
58895892
}
@@ -5903,9 +5906,9 @@ public boolean uploadCertificate(UploadCustomCertificateCmd cmd) throws Resource
59035906
//when cp reboots, the context will be reinit with the new cert
59045907
}
59055908
} catch (AgentUnavailableException e) {
5906-
s_logger.warn("Unable to send update certificate command to the console proxy resource", e);
5909+
s_logger.warn("Unable to send update certificate command to the console proxy resource as agent is unavailable", e);
59075910
} catch (OperationTimedoutException e) {
5908-
s_logger.warn("Unable to send update certificate command to the console proxy resource", e);
5911+
s_logger.warn("Unable to send update certificate command to the console proxy resource as there was a timeout", e);
59095912
}
59105913
}
59115914
return true;

0 commit comments

Comments
 (0)