Fixed authorizeSecurityGroupIngressRule to work with "name" parameter

This commit is contained in:
alena 2011-05-25 18:54:11 -07:00
parent cd6d933e48
commit 8a68e8148e
2 changed files with 10 additions and 1 deletions

View File

@ -120,6 +120,11 @@ public class AuthorizeSecurityGroupIngressCmd extends BaseAsyncCmd {
if (securityGroupId == null) {
throw new InvalidParameterValueException("Unable to find security group " + securityGroupName + " for account id=" + getEntityOwnerId());
}
securityGroupName = null;
}
if (securityGroupId == null) {
throw new InvalidParameterValueException("Either securityGroupId or securityGroupName is required by authorizeSecurityGroupIngress command");
}
return securityGroupId;

View File

@ -59,6 +59,10 @@ public class DeleteSecurityGroupCmd extends BaseCmd {
}
}
if (id == null) {
throw new InvalidParameterValueException("Either id or name parameter is requred by deleteSecurityGroup command");
}
return id;
}
@ -105,4 +109,4 @@ public class DeleteSecurityGroupCmd extends BaseCmd {
throw new ServerApiException(BaseCmd.RESOURCE_IN_USE_ERROR, ex.getMessage());
}
}
}
}