Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion server/src/com/cloud/network/router/NetworkHelperImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,13 @@ public DomainRouterVO startVirtualRouter(final DomainRouterVO router, final User
final List<Long> networkIds = _routerDao.getRouterNetworks(router.getId());

DomainRouterVO routerToBeAvoid = null;
List<DomainRouterVO> routerList = null;
if (networkIds.size() != 0) {
final List<DomainRouterVO> routerList = _routerDao.findByNetwork(networkIds.get(0));
routerList = _routerDao.findByNetwork(networkIds.get(0));
} else if (router.getVpcId() != null) {
routerList = _routerDao.listByVpcId(router.getVpcId());
}
if (routerList != null) {
for (final DomainRouterVO rrouter : routerList) {
if (rrouter.getHostId() != null && rrouter.getIsRedundantRouter() && rrouter.getState() == State.Running) {
if (routerToBeAvoid != null) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this also check that the routerList.size() is >= 2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be checked at some other places I think.
I am too lazy I just copied the lines from 380 to 390
https://github.com/apache/cloudstack/blob/4.11/server/src/com/cloud/network/router/NetworkHelperImpl.java#L380,L390

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be checked at some other places I think.
I am too lazy I just copied the lines from 380 to 390
https://github.com/apache/cloudstack/blob/4.11/server/src/com/cloud/network/router/NetworkHelperImpl.java#L380,L390

Expand Down