mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Adding fixes for the add user data and vpn rules
This commit is contained in:
parent
f2f4732854
commit
60eea3bb1a
@ -576,8 +576,8 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
|
||||
return null;
|
||||
}
|
||||
|
||||
Network network = _networkDao.findById(vpn.getNetworkId());
|
||||
DataCenterVO dcVO = _dcDao.findById(network.getDataCenterId());
|
||||
Vpc vpc = _entityMgr.findById(Vpc.class, vpn.getVpcId());
|
||||
DataCenterVO dcVO = _dcDao.findById(vpc.getZoneId());
|
||||
NetworkTopology networkTopology = networkTopologyContext.retrieveNetworkTopology(dcVO);
|
||||
|
||||
return networkTopology.applyVpnUsers(vpn, users, routers.get(0));
|
||||
|
||||
@ -657,8 +657,17 @@ public class CommandSetupHelper {
|
||||
|
||||
final IpAddress ip = _networkModel.getIp(vpn.getServerAddressId());
|
||||
|
||||
// This block is needed due to the line 206 of the
|
||||
// RemoteAccessVpnManagenerImpl:
|
||||
// TODO: assumes one virtual network / domr per account per zone
|
||||
final String cidr;
|
||||
final Network network = _networkDao.findById(vpn.getNetworkId());
|
||||
final String cidr = network.getCidr();
|
||||
if (network == null) {
|
||||
Vpc vpc = _vpcDao.findById(vpn.getVpcId());
|
||||
cidr = vpc.getCidr();
|
||||
} else {
|
||||
cidr = network.getCidr();
|
||||
}
|
||||
|
||||
final RemoteAccessVpnCfgCommand startVpnCmd = new RemoteAccessVpnCfgCommand(isCreate, ip.getAddress().addr(), vpn.getLocalIp(), vpn.getIpRange(),
|
||||
vpn.getIpsecPresharedKey(), vpn.getVpcId() != null);
|
||||
|
||||
@ -273,6 +273,7 @@ public class VirtualNetworkApplianceFactory {
|
||||
AdvancedVpnRules vpnRules = new AdvancedVpnRules(remoteAccessVpn, users);
|
||||
|
||||
initBeans(vpnRules);
|
||||
vpnRules._vpcDao = _vpcDao;
|
||||
|
||||
return vpnRules;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user