mirror of https://github.com/apache/cloudstack.git
Fix several wrong ResourceUnavailableException scopes
This commit is contained in:
parent
0c11ba2e22
commit
666a7aa974
|
|
@ -31,6 +31,7 @@ import com.cloud.api.commands.ConfigureVirtualRouterElementCmd;
|
|||
import com.cloud.api.commands.ListVirtualRouterElementsCmd;
|
||||
import com.cloud.configuration.ConfigurationManager;
|
||||
import com.cloud.configuration.dao.ConfigurationDao;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.deploy.DeployDestination;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
|
|
@ -190,7 +191,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
|
|||
VirtualMachineProfile<UserVm> uservm = (VirtualMachineProfile<UserVm>) vm;
|
||||
List<DomainRouterVO> routers = _routerMgr.deployVirtualRouter(network, dest, _accountMgr.getAccount(network.getAccountId()), uservm.getParameters(), offering.getRedundantRouter());
|
||||
if ((routers == null) || (routers.size() == 0)) {
|
||||
throw new ResourceUnavailableException("Can't find at least one running router!", this.getClass(), 0);
|
||||
throw new ResourceUnavailableException("Can't find at least one running router!", DataCenter.class, network.getDataCenterId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -735,7 +736,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
|
|||
}
|
||||
|
||||
if ((routers == null) || (routers.size() == 0)) {
|
||||
throw new ResourceUnavailableException("Can't find at least one router!", this.getClass(), 0);
|
||||
throw new ResourceUnavailableException("Can't find at least one router!", DataCenter.class, network.getDataCenterId());
|
||||
}
|
||||
|
||||
List<VirtualRouter> rets = _routerMgr.applyDhcpEntry(network, nic, uservm, dest, context, routers);
|
||||
|
|
@ -784,7 +785,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
|
|||
}
|
||||
|
||||
if ((routers == null) || (routers.size() == 0)) {
|
||||
throw new ResourceUnavailableException("Can't find at least one router!", this.getClass(), 0);
|
||||
throw new ResourceUnavailableException("Can't find at least one router!", DataCenter.class, network.getDataCenterId());
|
||||
}
|
||||
|
||||
List<VirtualRouter> rets = _routerMgr.applyUserData(network, nic, uservm, dest, context, routers);
|
||||
|
|
|
|||
|
|
@ -1448,7 +1448,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
+ ", but there are already two redundant routers with IP " + router.getPublicIpAddress()
|
||||
+ ", they are " + rrouter.getInstanceName() + "(" + rrouter.getId() + ") and "
|
||||
+ routerToBeAvoid.getInstanceName() + "(" + routerToBeAvoid.getId() + ")",
|
||||
this.getClass(), 0);
|
||||
DataCenter.class, rrouter.getDataCenterIdToDeployIn());
|
||||
}
|
||||
routerToBeAvoid = rrouter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ import com.cloud.consoleproxy.ConsoleProxyManager;
|
|||
import com.cloud.dc.ClusterVO;
|
||||
import com.cloud.dc.DataCenterVO;
|
||||
import com.cloud.dc.HostPodVO;
|
||||
import com.cloud.dc.Pod;
|
||||
import com.cloud.dc.dao.ClusterDao;
|
||||
import com.cloud.dc.dao.DataCenterDao;
|
||||
import com.cloud.dc.dao.HostPodDao;
|
||||
|
|
@ -1172,7 +1173,7 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
|
|||
// Check if there is host up in this cluster
|
||||
List<HostVO> allHosts = _resourceMgr.listAllUpAndEnabledHosts(Host.Type.Routing, clusterId, podId, zoneId);
|
||||
if (allHosts.isEmpty()) {
|
||||
throw new ResourceUnavailableException("No host up to associate a storage pool with in cluster " + clusterId, HostPodVO.class, podId);
|
||||
throw new ResourceUnavailableException("No host up to associate a storage pool with in cluster " + clusterId, Pod.class, podId);
|
||||
}
|
||||
URI uri = null;
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue