DaanHoogland commented on a change in pull request #3378: project id added in 
test
URL: https://github.com/apache/cloudstack/pull/3378#discussion_r299862808
 
 

 ##########
 File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
 ##########
 @@ -646,7 +646,16 @@
 
         Ternary<Long, Boolean, ListProjectResourcesCriteria> 
domainIdRecursiveListProject = new Ternary<Long, Boolean, 
ListProjectResourcesCriteria>(cmd.getDomainId(), cmd.isRecursive(), null);
 
-        _accountMgr.buildACLSearchParameters(caller, null, 
cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, 
domainIdRecursiveListProject, listAll, false);
+        Long projectId = cmd.getProjectId();
+        if (resourceType.equalsIgnoreCase("project") && projectId == null) {
+            try {
+                projectId = Long.parseLong(resourceId);
+            } catch (NumberFormatException e) {
+                projectId = _projectDao.findByUuid(resourceId).getId();
 
 Review comment:
   it throws an exception: garbage in, garbage out. should we handle that? I 
think it is the exception @rhtyd is pointing at. How do you suggest this should 
be handled?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to