Adding fixes for the add user data and vpn rules

This commit is contained in:
Wilder Rodrigues 2014-09-08 17:30:01 +02:00 committed by wilderrodrigues
parent f2f4732854
commit 60eea3bb1a
3 changed files with 13 additions and 3 deletions

View File

@ -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));

View File

@ -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);

View File

@ -273,6 +273,7 @@ public class VirtualNetworkApplianceFactory {
AdvancedVpnRules vpnRules = new AdvancedVpnRules(remoteAccessVpn, users);
initBeans(vpnRules);
vpnRules._vpcDao = _vpcDao;
return vpnRules;
}