mirror of https://github.com/apache/jclouds.git
Merge pull request #679 from aplowe/cloudstackfix
Fix for cloudstack ip to network mapping call
This commit is contained in:
commit
a12e10d7f3
|
@ -48,7 +48,7 @@ public class AdvancedNetworkOptionsConverter implements OptionsConverter {
|
||||||
checkArgument(templateOptions.getSecurityGroupIds().isEmpty(), "security groups cannot be specified for locations (zones) that use advanced networking");
|
checkArgument(templateOptions.getSecurityGroupIds().isEmpty(), "security groups cannot be specified for locations (zones) that use advanced networking");
|
||||||
if (templateOptions.getNetworkIds().size() > 0) {
|
if (templateOptions.getNetworkIds().size() > 0) {
|
||||||
options.networkIds(templateOptions.getNetworkIds());
|
options.networkIds(templateOptions.getNetworkIds());
|
||||||
} else {
|
} else if (templateOptions.getIpsToNetworks().isEmpty()) {
|
||||||
checkArgument(!networks.isEmpty(), "please setup a network for zone: " + zoneId);
|
checkArgument(!networks.isEmpty(), "please setup a network for zone: " + zoneId);
|
||||||
Network defaultNetworkInZone = Iterables.getFirst(filter(networks.values(), and(defaultNetworkInZone(zoneId), supportsStaticNAT())), null);
|
Network defaultNetworkInZone = Iterables.getFirst(filter(networks.values(), and(defaultNetworkInZone(zoneId), supportsStaticNAT())), null);
|
||||||
if(defaultNetworkInZone == null) {
|
if(defaultNetworkInZone == null) {
|
||||||
|
|
|
@ -129,8 +129,8 @@ public class DeployVirtualMachineOptions extends AccountInDomainOptions {
|
||||||
public DeployVirtualMachineOptions ipsToNetworks(Map<String, String> ipsToNetworks) {
|
public DeployVirtualMachineOptions ipsToNetworks(Map<String, String> ipsToNetworks) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (String ip : ipsToNetworks.keySet()) {
|
for (String ip : ipsToNetworks.keySet()) {
|
||||||
this.queryParameters.replaceValues(String.format("ipnetworklist[%d].ip", count), ImmutableSet.of(ip));
|
this.queryParameters.replaceValues(String.format("iptonetworklist[%d].ip", count), ImmutableSet.of(ip));
|
||||||
this.queryParameters.replaceValues(String.format("ipnetworklist[%d].networkid", count),
|
this.queryParameters.replaceValues(String.format("iptonetworklist[%d].networkid", count),
|
||||||
ImmutableSet.of("" + ipsToNetworks.get(ip)));
|
ImmutableSet.of("" + ipsToNetworks.get(ip)));
|
||||||
count += 1;
|
count += 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue