rhtyd commented on a change in pull request #3476: [WIP] Smoketests fixes and 
master stabilisation
URL: https://github.com/apache/cloudstack/pull/3476#discussion_r301423699
 
 

 ##########
 File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
 ##########
 @@ -640,10 +641,22 @@
         String resourceType = cmd.getResourceType();
         String customerName = cmd.getCustomer();
         boolean listAll = cmd.listAll();
+        Long projectId = cmd.getProjectId();
+
+        if (projectId == null && 
ResourceObjectType.Project.name().equalsIgnoreCase(resourceType) && 
!Strings.isNullOrEmpty(resourceId)) {
+            try {
+                projectId = Long.parseLong(resourceId);
+            } catch (final NumberFormatException e) {
+                final ProjectVO project = 
_projectDao.findByUuidIncludingRemoved(resourceId);
+                if (project != null) {
+                    projectId = project.getId();
+                }
 
 Review comment:
   This will continue to search and return empty result/response. This only 
happens when a user does not pass the projectId and invalid resourceid or does 
not pass the resourceid. I checked against 4.11 for behaviour and tried to fix 
in a way that user experience is same as 4.11.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to