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

 ##########
 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:
   so, if projectId is still null here, return empty result or continue on 
searching ?

----------------------------------------------------------------
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