You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2019/07/08 11:51:37 UTC

[GitHub] [cloudstack] rhtyd commented on a change in pull request #3476: [WIP] Smoketests fixes and master stabilisation

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

 ##########
 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:
   Yes, if projectid is not passed and invalid resourceid is passed. 

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