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 2022/03/14 07:58:22 UTC

[GitHub] [cloudstack] davidjumani opened a new pull request #6111: Fix recursive lookup for offerings for users

davidjumani opened a new pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111


   ### Description
   
   Since users are not allowed to list offerings recursively and isrecursive is set to true by default if listall is true, this throws an exception when listing offerings
   This PR fixes it by ensuring that users can not list offerings recursively
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [x] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067548559


   @davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067896029


   @blueorangutan test


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067476991


   <b>Trillian test result (tid-3599)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 29067 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6111-t3599-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1068715768


   @blueorangutan test


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067029556


   @blueorangutan package


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067081383


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 2870


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067893383


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 2885


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on a change in pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#discussion_r826978262



##########
File path: api/src/main/java/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
##########
@@ -42,7 +45,10 @@ public boolean listAll() {
     @Override
     public boolean isRecursive() {
         if (listAll()) {
-            return recursive == null ? true : recursive;
+            Account caller = CallContext.current().getCallingAccount();
+            if (caller.getType() != Account.Type.NORMAL) {
+                return recursive == null ? true : recursive;

Review comment:
       Could be simplified to
   ```suggestion
                   return recursive == null || recursive;
   ```

##########
File path: api/src/main/java/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
##########
@@ -42,7 +45,10 @@ public boolean listAll() {
     @Override
     public boolean isRecursive() {
         if (listAll()) {
-            return recursive == null ? true : recursive;
+            Account caller = CallContext.current().getCallingAccount();
+            if (caller.getType() != Account.Type.NORMAL) {
+                return recursive == null ? true : recursive;
+            }
         }
         return recursive == null ? false : recursive;

Review comment:
       Could probably be simplified to:
   ```suggestion
           return recursive != null && recursive;
   ```




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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067088124


   @nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1068784004


   Closing in favour of #6125 


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani closed pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
davidjumani closed pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111


   


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067086585


   @blueorangutan test


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067548442


   @blueorangutan test


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067029982


   @nvazquez a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#discussion_r827010965



##########
File path: api/src/main/java/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
##########
@@ -42,7 +45,10 @@ public boolean listAll() {
     @Override
     public boolean isRecursive() {
         if (listAll()) {
-            return recursive == null ? true : recursive;
+            Account caller = CallContext.current().getCallingAccount();
+            if (caller.getType() != Account.Type.NORMAL) {
+                return recursive == null ? true : recursive;
+            }
         }
         return recursive == null ? false : recursive;

Review comment:
       hm, that is not more expressive, i'd say.




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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1068715982


   @davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#discussion_r827012156



##########
File path: api/src/main/java/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
##########
@@ -42,7 +45,10 @@ public boolean listAll() {
     @Override
     public boolean isRecursive() {
         if (listAll()) {
-            return recursive == null ? true : recursive;
+            Account caller = CallContext.current().getCallingAccount();
+            if (caller.getType() != Account.Type.NORMAL) {
+                return recursive == null ? true : recursive;

Review comment:
       more concise, less readable /m no me gusta




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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067855066


   @davidjumani a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] davidjumani commented on pull request #6111: Fix recursive lookup for offerings for users

Posted by GitBox <gi...@apache.org>.
davidjumani commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067853505


   @blueorangutan package


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1067896873


   @nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #6111: Set isrecursive to false when listall=true by default for users

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #6111:
URL: https://github.com/apache/cloudstack/pull/6111#issuecomment-1068499880


   <b>Trillian test result (tid-3613)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 34034 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6111-t3613-kvm-centos7.zip
   Smoke tests completed. 87 look OK, 5 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_add_primary_storage_disabled_host | `Error` | 0.63 | test_primary_storage.py
   test_01_primary_storage_nfs | `Error` | 0.11 | test_primary_storage.py
   ContextSuite context=TestStorageTags>:setup | `Error` | 0.19 | test_primary_storage.py
   test_03_deploy_and_scale_kubernetes_cluster | `Failure` | 29.86 | test_kubernetes_clusters.py
   test_07_deploy_kubernetes_ha_cluster | `Failure` | 60.50 | test_kubernetes_clusters.py
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 40.13 | test_kubernetes_clusters.py
   test_09_delete_kubernetes_ha_cluster | `Failure` | 0.05 | test_kubernetes_clusters.py
   ContextSuite context=TestKubernetesCluster>:teardown | `Error` | 78.75 | test_kubernetes_clusters.py
   test_01_secure_vm_migration | `Error` | 151.49 | test_vm_life_cycle.py
   test_02_unsecure_vm_migration | `Error` | 267.94 | test_vm_life_cycle.py
   test_03_secured_to_nonsecured_vm_migration | `Error` | 142.87 | test_vm_life_cycle.py
   test_08_migrate_vm | `Error` | 43.70 | test_vm_life_cycle.py
   test_02_list_snapshots_with_removed_data_store | `Error` | 9.43 | test_snapshots.py
   test_02_list_snapshots_with_removed_data_store | `Error` | 9.44 | test_snapshots.py
   test_hostha_enable_ha_when_host_in_maintenance | `Error` | 303.73 | test_hostha_kvm.py
   


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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org