|
100 | 100 | import com.cloud.host.Host; |
101 | 101 | import com.cloud.host.HostVO; |
102 | 102 | import com.cloud.host.dao.HostDao; |
| 103 | +import com.cloud.hypervisor.Hypervisor; |
103 | 104 | import com.cloud.hypervisor.Hypervisor.HypervisorType; |
104 | 105 | import com.cloud.network.FirewallRuleVO; |
105 | 106 | import com.cloud.network.IPAddressVO; |
@@ -900,7 +901,7 @@ public DomainRouterVO start(long routerId, long startEventId) throws StorageUnav |
900 | 901 | String privateIpAddress = null; |
901 | 902 | String privateNetMask = null; |
902 | 903 |
|
903 | | - if(_defaultHypervisorType == null || !_defaultHypervisorType.equalsIgnoreCase("VmWare")) { |
| 904 | + if(_defaultHypervisorType == null || !_defaultHypervisorType.equalsIgnoreCase(Hypervisor.HypervisorType.VmWare.toString())) { |
904 | 905 | privateIpAddress = _dcDao.allocateLinkLocalPrivateIpAddress(router.getDataCenterId(), routingHost.getPodId(), router.getId()); |
905 | 906 | privateNetMask = NetUtils.getLinkLocalNetMask(); |
906 | 907 | } else { |
@@ -994,7 +995,7 @@ public DomainRouterVO start(long routerId, long startEventId) throws StorageUnav |
994 | 995 |
|
995 | 996 | router.setPrivateIpAddress(null); |
996 | 997 |
|
997 | | - if(_defaultHypervisorType == null || !_defaultHypervisorType.equalsIgnoreCase("VmWare")) |
| 998 | + if(_defaultHypervisorType == null || !_defaultHypervisorType.equalsIgnoreCase(Hypervisor.HypervisorType.VmWare.toString())) |
998 | 999 | _dcDao.releaseLinkLocalPrivateIpAddress(privateIpAddress, router.getDataCenterId(), router.getId()); |
999 | 1000 | else |
1000 | 1001 | _dcDao.releasePrivateIpAddress(privateIpAddress, router.getDataCenterId(), router.getId()); |
@@ -1407,7 +1408,7 @@ public boolean configure(final String name, final Map<String, Object> params) th |
1407 | 1408 | String value = configs.get("start.retry"); |
1408 | 1409 | _retry = NumbersUtil.parseInt(value, 2); |
1409 | 1410 |
|
1410 | | - _defaultHypervisorType = (String)params.get(Config.HypervisorDefaultType.key()); |
| 1411 | + _defaultHypervisorType = _configDao.getValue(Config.HypervisorDefaultType.key()); |
1411 | 1412 |
|
1412 | 1413 | value = configs.get("router.stats.interval"); |
1413 | 1414 | _routerStatsInterval = NumbersUtil.parseInt(value, 300); |
@@ -1515,7 +1516,7 @@ public void completeStopCommand(final DomainRouterVO router, final Event ev) { |
1515 | 1516 | String privateIpAddress = router.getPrivateIpAddress(); |
1516 | 1517 |
|
1517 | 1518 | if (privateIpAddress != null) { |
1518 | | - if(_defaultHypervisorType == null || !_defaultHypervisorType.equalsIgnoreCase("VmWare")) |
| 1519 | + if(_defaultHypervisorType == null || !_defaultHypervisorType.equalsIgnoreCase(Hypervisor.HypervisorType.VmWare.toString())) |
1519 | 1520 | _dcDao.releaseLinkLocalPrivateIpAddress(privateIpAddress, router.getDataCenterId(), router.getId()); |
1520 | 1521 | else |
1521 | 1522 | _dcDao.releasePrivateIpAddress(privateIpAddress, router.getDataCenterId(), router.getId()); |
|
0 commit comments