Skip to content

Commit 96e51f2

Browse files
committed
address copilot review concerns
1 parent 0aed4d0 commit 96e51f2

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

server/src/main/java/org/apache/cloudstack/network/ssl/CertServiceImpl.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public List<SslCertResponse> listSslCerts(final ListSslCertsCmd listSslCertCmd)
205205
final String accountName = listSslCertCmd.getAccountName();
206206
final Long domainId = listSslCertCmd.getDomainId();
207207

208-
if (accountId != null && (accountName != null || domainId != null)) {
208+
if (accountId != null && (StringUtils.isNotBlank(accountName) || domainId != null)) {
209209
throw new InvalidParameterValueException("The accountid and account/domainid are mutually exclusive");
210210
}
211211

@@ -229,8 +229,6 @@ public List<SslCertResponse> listSslCerts(final ListSslCertsCmd listSslCertCmd)
229229
Account owner = null;
230230
if (StringUtils.isNotEmpty(accountName)) {
231231
owner = _accountMgr.finalizeOwner(caller, accountName, domainId, projectId);
232-
} else if (accountId != null) {
233-
owner = _accountMgr.getAccount(accountId);
234232
} else {
235233
owner = caller;
236234
}
@@ -301,7 +299,7 @@ public List<SslCertResponse> listSslCerts(final ListSslCertsCmd listSslCertCmd)
301299
return certResponseList;
302300
}
303301

304-
final List<SslCertVO> certVOList = _sslCertDao.listByAccountId(owner.getId());
302+
final List<SslCertVO> certVOList = _sslCertDao.listByAccountId(accountId != null ? accountId : owner.getId());
305303
if (certVOList == null || certVOList.isEmpty()) {
306304
return certResponseList;
307305
}

0 commit comments

Comments
 (0)