bug 3120: incremental checkin

This commit is contained in:
abhishek 2010-09-16 12:02:29 -07:00
parent 131e487c32
commit 6731dc66f1

View File

@ -48,7 +48,8 @@ public class AssociateIPAddrCmd extends BaseCmd {
s_properties.add(new Pair<Enum, Boolean>(BaseCmd.Properties.DOMAIN_ID, Boolean.FALSE));
s_properties.add(new Pair<Enum, Boolean>(BaseCmd.Properties.ACCOUNT_OBJ, Boolean.FALSE));
s_properties.add(new Pair<Enum, Boolean>(BaseCmd.Properties.USER_ID, Boolean.FALSE));
s_properties.add(new Pair<Enum, Boolean>(BaseCmd.Properties.ZONE_ID, Boolean.TRUE));
s_properties.add(new Pair<Enum, Boolean>(BaseCmd.Properties.ZONE_ID, Boolean.TRUE));
s_properties.add(new Pair<Enum, Boolean>(BaseCmd.Properties.VIRTUAL_MACHINE_ID, Boolean.FALSE));
}
public String getName() {
@ -69,7 +70,8 @@ public class AssociateIPAddrCmd extends BaseCmd {
Account account = (Account)params.get(BaseCmd.Properties.ACCOUNT_OBJ.getName());
Long userId = (Long)params.get(BaseCmd.Properties.USER_ID.getName());
String accountName = (String)params.get(BaseCmd.Properties.ACCOUNT.getName());
Long domainId = (Long)params.get(BaseCmd.Properties.DOMAIN_ID.getName());
Long domainId = (Long)params.get(BaseCmd.Properties.DOMAIN_ID.getName());
Long vmId = (Long)params.get(BaseCmd.Properties.VIRTUAL_MACHINE_ID.getName());
String newIpAddr = null;
String errorDesc = null;
Long accountId = null;
@ -104,7 +106,13 @@ public class AssociateIPAddrCmd extends BaseCmd {
if (userId == null) {
userId = Long.valueOf(1);
}
//vmId == 0 => general flow
//vmId = 1 => 1:1 NAT
if(vmId == null){
vmId = Long.valueOf(0);
}
try {
newIpAddr = getManagementServer().associateIpAddress(userId.longValue(), accountId.longValue(), domainId.longValue(), zoneId.longValue());
} catch (ResourceAllocationException rae) {