Skip to content

Commit

Permalink
Merge pull request jclouds#679 from aplowe/cloudstackfix
Browse files Browse the repository at this point in the history
Fix for cloudstack ip to network mapping call
  • Loading branch information
Adrian Cole committed Jun 20, 2012
2 parents 805712d + 2526e7a commit a12e10d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public DeployVirtualMachineOptions apply(CloudStackTemplateOptions templateOptio
checkArgument(templateOptions.getSecurityGroupIds().isEmpty(), "security groups cannot be specified for locations (zones) that use advanced networking");
if (templateOptions.getNetworkIds().size() > 0) {
options.networkIds(templateOptions.getNetworkIds());
} else {
} else if (templateOptions.getIpsToNetworks().isEmpty()) {
checkArgument(!networks.isEmpty(), "please setup a network for zone: " + zoneId);
Network defaultNetworkInZone = Iterables.getFirst(filter(networks.values(), and(defaultNetworkInZone(zoneId), supportsStaticNAT())), null);
if(defaultNetworkInZone == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ public DeployVirtualMachineOptions ipOnDefaultNetwork(String ipOnDefaultNetwork)
public DeployVirtualMachineOptions ipsToNetworks(Map<String, String> ipsToNetworks) {
int count = 0;
for (String ip : ipsToNetworks.keySet()) {
this.queryParameters.replaceValues(String.format("ipnetworklist[%d].ip", count), ImmutableSet.of(ip));
this.queryParameters.replaceValues(String.format("ipnetworklist[%d].networkid", count),
this.queryParameters.replaceValues(String.format("iptonetworklist[%d].ip", count), ImmutableSet.of(ip));
this.queryParameters.replaceValues(String.format("iptonetworklist[%d].networkid", count),
ImmutableSet.of("" + ipsToNetworks.get(ip)));
count += 1;
}
Expand Down

0 comments on commit a12e10d

Please sign in to comment.