Skip to content

Commit 8a68e81

Browse files
committed
Fixed authorizeSecurityGroupIngressRule to work with "name" parameter
1 parent cd6d933 commit 8a68e81

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ public Long getSecurityGroupId() {
120120
if (securityGroupId == null) {
121121
throw new InvalidParameterValueException("Unable to find security group " + securityGroupName + " for account id=" + getEntityOwnerId());
122122
}
123+
securityGroupName = null;
124+
}
125+
126+
if (securityGroupId == null) {
127+
throw new InvalidParameterValueException("Either securityGroupId or securityGroupName is required by authorizeSecurityGroupIngress command");
123128
}
124129

125130
return securityGroupId;

api/src/com/cloud/api/commands/DeleteSecurityGroupCmd.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public Long getId() {
5959
}
6060
}
6161

62+
if (id == null) {
63+
throw new InvalidParameterValueException("Either id or name parameter is requred by deleteSecurityGroup command");
64+
}
65+
6266
return id;
6367
}
6468

@@ -105,4 +109,4 @@ public void execute(){
105109
throw new ServerApiException(BaseCmd.RESOURCE_IN_USE_ERROR, ex.getMessage());
106110
}
107111
}
108-
}
112+
}

0 commit comments

Comments
 (0)