cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cloudstack] ustcweizhou commented on a change in pull request #3476: [WIP] Smoketests fixes and master stabilisation
Date Mon, 08 Jul 2019 18:22:20 GMT
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message