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 2020/06/15 06:13:52 UTC

[GitHub] [cloudstack] davidjumani opened a new pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


   ## Description
   This fixes the issue of listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin which is a potential security bug. It now only extends ListVMsCmd, so only admins can see additional details such as internal instance name, etc
   No similar issue for listVolumeMetics, listStoragePoolMetrics, etc
   Fixes: #4143 
   
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ## Screenshots (if appropriate):
   
   ## How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   <!-- see how your change affects other areas of the code, etc. -->
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
   


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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] davidjumani commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


   @davidjumani a Jenkins job has been kicked to build packages. 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.

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



[GitHub] [cloudstack] weizhouapache commented on a change in pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -781,7 +781,8 @@
         Pair<List<UserVmJoinVO>, Integer> result = searchForUserVMsInternal(cmd);
         ListResponse<UserVmResponse> response = new ListResponse<UserVmResponse>();
         ResponseView respView = ResponseView.Restricted;
-        if (cmd instanceof ListVMsCmdByAdmin) {
+        Account caller = CallContext.current().getCallingAccount();
+        if (_accountMgr.isAdmin(caller.getId())) {

Review comment:
       @davidjumani  it should be isRootAdmin instead of isAdmin
   




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



[GitHub] [cloudstack] rhtyd commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] rhtyd commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


   <b>Trillian test result (tid-1734)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 39861 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4145-t1734-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
   Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Smoke tests completed. 75 look OK, 2 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | `Failure` | 3668.56 | test_internal_lb.py
   test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | `Error` | 3670.09 | test_internal_lb.py
   test_02_vpc_privategw_static_routes | `Failure` | 189.23 | test_privategw_acl.py
   test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 207.79 | test_privategw_acl.py
   test_04_rvpc_privategw_static_routes | `Failure` | 345.35 | test_privategw_acl.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.

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



[GitHub] [cloudstack] rhtyd merged pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

Posted by GitBox <gi...@apache.org>.
rhtyd merged pull request #4145:
URL: https://github.com/apache/cloudstack/pull/4145


   


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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


   @rhtyd a Jenkins job has been kicked to build packages. 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.

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


   Packaging result: ✔centos7 ✔debian. JID-1380


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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


   <b>Trillian test result (tid-1727)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 37511 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4145-t1727-kvm-centos7.zip
   Smoke tests completed. 83 look OK, 0 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


   <b>Trillian test result (tid-1759)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 31354 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4145-t1759-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Smoke tests completed. 76 look OK, 1 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_vpc_privategw_static_routes | `Failure` | 222.90 | test_privategw_acl.py
   test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 267.48 | test_privategw_acl.py
   test_04_rvpc_privategw_static_routes | `Failure` | 249.62 | test_privategw_acl.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.

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



[GitHub] [cloudstack] blueorangutan removed a comment on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

Posted by GitBox <gi...@apache.org>.
blueorangutan removed a comment on pull request #4145:
URL: https://github.com/apache/cloudstack/pull/4145#issuecomment-645585175


   <b>Trillian test result (tid-1745)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 63062 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4145-t1745-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_public_ip_range.py
   Intermittent failure detected: /marvin/tests/smoke/test_reset_vm_on_reboot.py
   Intermittent failure detected: /marvin/tests/smoke/test_resource_accounting.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dhcphosts.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dns.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dnsservice.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_iptables_default_policy.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers.py
   Intermittent failure detected: /marvin/tests/smoke/test_secondary_storage.py
   Intermittent failure detected: /marvin/tests/smoke/test_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_snapshots.py
   Intermittent failure detected: /marvin/tests/smoke/test_ssvm.py
   Intermittent failure detected: /marvin/tests/smoke/test_templates.py
   Intermittent failure detected: /marvin/tests/smoke/test_usage.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_snapshots.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_router_nics.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
   Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
   Smoke tests completed. 55 look OK, 22 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_vpc_privategw_static_routes | `Failure` | 212.16 | test_privategw_acl.py
   test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 213.11 | test_privategw_acl.py
   test_04_rvpc_privategw_static_routes | `Failure` | 394.54 | test_privategw_acl.py
   ContextSuite context=TestResetVmOnReboot>:setup | `Error` | 0.00 | test_reset_vm_on_reboot.py
   ContextSuite context=TestRAMCPUResourceAccounting>:setup | `Error` | 0.00 | test_resource_accounting.py
   ContextSuite context=TestRouterDHCPHosts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDHCPOpts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDns>:setup | `Error` | 0.00 | test_router_dns.py
   test_01_sys_vm_start | `Failure` | 0.11 | test_secondary_storage.py
   ContextSuite context=TestRouterDnsService>:setup | `Error` | 0.00 | test_router_dnsservice.py
   ContextSuite context=TestRouterIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestVPCIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestIsolatedNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRedundantIsolateNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRouterServices>:setup | `Error` | 0.00 | test_routers.py
   ContextSuite context=TestCpuCapServiceOfferings>:setup | `Error` | 0.00 | test_service_offerings.py
   ContextSuite context=TestServiceOfferings>:setup | `Error` | 0.23 | test_service_offerings.py
   ContextSuite context=TestSnapshotRootDisk>:setup | `Error` | 0.00 | test_snapshots.py
   test_01_list_sec_storage_vm | `Failure` | 0.04 | test_ssvm.py
   test_02_list_cpvm_vm | `Failure` | 0.03 | test_ssvm.py
   test_03_ssvm_internals | `Failure` | 0.03 | test_ssvm.py
   test_04_cpvm_internals | `Failure` | 0.04 | test_ssvm.py
   test_05_stop_ssvm | `Failure` | 0.04 | test_ssvm.py
   test_06_stop_cpvm | `Failure` | 0.03 | test_ssvm.py
   test_07_reboot_ssvm | `Failure` | 0.04 | test_ssvm.py
   test_08_reboot_cpvm | `Failure` | 0.04 | test_ssvm.py
   test_09_destroy_ssvm | `Failure` | 0.04 | test_ssvm.py
   test_10_destroy_cpvm | `Failure` | 0.03 | test_ssvm.py
   test_02_create_template_with_checksum_sha1 | `Error` | 65.53 | test_templates.py
   test_03_create_template_with_checksum_sha256 | `Error` | 65.47 | test_templates.py
   test_04_create_template_with_checksum_md5 | `Error` | 65.46 | test_templates.py
   test_05_create_template_with_no_checksum | `Error` | 65.46 | test_templates.py
   test_02_deploy_vm_from_direct_download_template | `Error` | 1.30 | test_templates.py
   test_03_deploy_vm_wrong_checksum | `Error` | 1.39 | test_templates.py
   ContextSuite context=TestTemplates>:setup | `Error` | 17.66 | test_templates.py
   ContextSuite context=TestISOUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestLBRuleUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestNatRuleUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestPublicIPUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestSnapshotUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVmUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVolumeUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVpnUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=Test01DeployVM>:setup | `Error` | 0.00 | test_vm_life_cycle.py
   ContextSuite context=Test02VMLifeCycle>:setup | `Error` | 0.00 | test_vm_life_cycle.py
   test_14_secure_to_secure_vm_migration | `Error` | 11.41 | test_vm_life_cycle.py
   test_15_secured_to_nonsecured_vm_migration | `Error` | 74.14 | test_vm_life_cycle.py
   test_16_nonsecured_to_secured_vm_migration | `Error` | 1.27 | test_vm_life_cycle.py
   ContextSuite context=TestVmSnapshot>:setup | `Error` | 2.06 | test_vm_snapshots.py
   ContextSuite context=TestCreateVolume>:setup | `Error` | 0.00 | test_volumes.py
   ContextSuite context=TestVolumes>:setup | `Error` | 0.00 | test_volumes.py
   ContextSuite context=TestVPCRedundancy>:setup | `Error` | 0.00 | test_vpc_redundant.py
   ContextSuite context=TestVPCNics>:setup | `Error` | 0.00 | test_vpc_router_nics.py
   ContextSuite context=TestRVPCSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVPCSite2SiteVPNMultipleOptions>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVpcRemoteAccessVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVpcSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   test_disable_oobm_ha_state_ineligible | `Error` | 1513.57 | 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.

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



[GitHub] [cloudstack] rhtyd commented on a change in pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -781,7 +781,8 @@
         Pair<List<UserVmJoinVO>, Integer> result = searchForUserVMsInternal(cmd);
         ListResponse<UserVmResponse> response = new ListResponse<UserVmResponse>();
         ResponseView respView = ResponseView.Restricted;
-        if (cmd instanceof ListVMsCmdByAdmin) {
+        Account caller = CallContext.current().getCallingAccount();
+        if (_accountMgr.isAdmin(caller.getId())) {

Review comment:
       Nevermind, I checked and made that fix.




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



[GitHub] [cloudstack] rhtyd commented on a change in pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -781,7 +781,8 @@
         Pair<List<UserVmJoinVO>, Integer> result = searchForUserVMsInternal(cmd);
         ListResponse<UserVmResponse> response = new ListResponse<UserVmResponse>();
         ResponseView respView = ResponseView.Restricted;
-        if (cmd instanceof ListVMsCmdByAdmin) {
+        Account caller = CallContext.current().getCallingAccount();
+        if (_accountMgr.isAdmin(caller.getId())) {

Review comment:
       @davidjumani yes, root admin. Check if `isAdmin` checks for only root admin, or would it pass for domain admin. The fix needed here is to check if caller is a root admin.




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



[GitHub] [cloudstack] davidjumani commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] rhtyd commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] rhtyd commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] davidjumani commented on a change in pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -781,7 +781,8 @@
         Pair<List<UserVmJoinVO>, Integer> result = searchForUserVMsInternal(cmd);
         ListResponse<UserVmResponse> response = new ListResponse<UserVmResponse>();
         ResponseView respView = ResponseView.Restricted;
-        if (cmd instanceof ListVMsCmdByAdmin) {
+        Account caller = CallContext.current().getCallingAccount();
+        if (_accountMgr.isAdmin(caller.getId())) {

Review comment:
       @weizhouapache Does it detect ListVMsCmd as ListVMsCmdByAdmin for a regular admin ?




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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


   Packaging result: ✔centos7 ✔debian. JID-1377


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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


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

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



[GitHub] [cloudstack] davidjumani commented on a change in pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -781,7 +781,8 @@
         Pair<List<UserVmJoinVO>, Integer> result = searchForUserVMsInternal(cmd);
         ListResponse<UserVmResponse> response = new ListResponse<UserVmResponse>();
         ResponseView respView = ResponseView.Restricted;
-        if (cmd instanceof ListVMsCmdByAdmin) {
+        Account caller = CallContext.current().getCallingAccount();
+        if (_accountMgr.isAdmin(caller.getId())) {

Review comment:
       Does it detect ListVMsCmd as ListVMsCmdByAdmin for a regular admin ?




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



[GitHub] [cloudstack] blueorangutan commented on pull request #4145: Fixing listVirtualMachinesMetrics to extend ListVMsCmd instead of ListVMsCmdByAdmin

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


   <b>Trillian test result (tid-1745)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 63062 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4145-t1745-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_public_ip_range.py
   Intermittent failure detected: /marvin/tests/smoke/test_reset_vm_on_reboot.py
   Intermittent failure detected: /marvin/tests/smoke/test_resource_accounting.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dhcphosts.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dns.py
   Intermittent failure detected: /marvin/tests/smoke/test_router_dnsservice.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_iptables_default_policy.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
   Intermittent failure detected: /marvin/tests/smoke/test_routers.py
   Intermittent failure detected: /marvin/tests/smoke/test_secondary_storage.py
   Intermittent failure detected: /marvin/tests/smoke/test_service_offerings.py
   Intermittent failure detected: /marvin/tests/smoke/test_snapshots.py
   Intermittent failure detected: /marvin/tests/smoke/test_ssvm.py
   Intermittent failure detected: /marvin/tests/smoke/test_templates.py
   Intermittent failure detected: /marvin/tests/smoke/test_usage.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_snapshots.py
   Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_router_nics.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
   Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
   Smoke tests completed. 55 look OK, 22 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_vpc_privategw_static_routes | `Failure` | 212.16 | test_privategw_acl.py
   test_03_vpc_privategw_restart_vpc_cleanup | `Failure` | 213.11 | test_privategw_acl.py
   test_04_rvpc_privategw_static_routes | `Failure` | 394.54 | test_privategw_acl.py
   ContextSuite context=TestResetVmOnReboot>:setup | `Error` | 0.00 | test_reset_vm_on_reboot.py
   ContextSuite context=TestRAMCPUResourceAccounting>:setup | `Error` | 0.00 | test_resource_accounting.py
   ContextSuite context=TestRouterDHCPHosts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDHCPOpts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDns>:setup | `Error` | 0.00 | test_router_dns.py
   test_01_sys_vm_start | `Failure` | 0.11 | test_secondary_storage.py
   ContextSuite context=TestRouterDnsService>:setup | `Error` | 0.00 | test_router_dnsservice.py
   ContextSuite context=TestRouterIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestVPCIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestIsolatedNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRedundantIsolateNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRouterServices>:setup | `Error` | 0.00 | test_routers.py
   ContextSuite context=TestCpuCapServiceOfferings>:setup | `Error` | 0.00 | test_service_offerings.py
   ContextSuite context=TestServiceOfferings>:setup | `Error` | 0.23 | test_service_offerings.py
   ContextSuite context=TestSnapshotRootDisk>:setup | `Error` | 0.00 | test_snapshots.py
   test_01_list_sec_storage_vm | `Failure` | 0.04 | test_ssvm.py
   test_02_list_cpvm_vm | `Failure` | 0.03 | test_ssvm.py
   test_03_ssvm_internals | `Failure` | 0.03 | test_ssvm.py
   test_04_cpvm_internals | `Failure` | 0.04 | test_ssvm.py
   test_05_stop_ssvm | `Failure` | 0.04 | test_ssvm.py
   test_06_stop_cpvm | `Failure` | 0.03 | test_ssvm.py
   test_07_reboot_ssvm | `Failure` | 0.04 | test_ssvm.py
   test_08_reboot_cpvm | `Failure` | 0.04 | test_ssvm.py
   test_09_destroy_ssvm | `Failure` | 0.04 | test_ssvm.py
   test_10_destroy_cpvm | `Failure` | 0.03 | test_ssvm.py
   test_02_create_template_with_checksum_sha1 | `Error` | 65.53 | test_templates.py
   test_03_create_template_with_checksum_sha256 | `Error` | 65.47 | test_templates.py
   test_04_create_template_with_checksum_md5 | `Error` | 65.46 | test_templates.py
   test_05_create_template_with_no_checksum | `Error` | 65.46 | test_templates.py
   test_02_deploy_vm_from_direct_download_template | `Error` | 1.30 | test_templates.py
   test_03_deploy_vm_wrong_checksum | `Error` | 1.39 | test_templates.py
   ContextSuite context=TestTemplates>:setup | `Error` | 17.66 | test_templates.py
   ContextSuite context=TestISOUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestLBRuleUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestNatRuleUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestPublicIPUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestSnapshotUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVmUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVolumeUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=TestVpnUsage>:setup | `Error` | 0.00 | test_usage.py
   ContextSuite context=Test01DeployVM>:setup | `Error` | 0.00 | test_vm_life_cycle.py
   ContextSuite context=Test02VMLifeCycle>:setup | `Error` | 0.00 | test_vm_life_cycle.py
   test_14_secure_to_secure_vm_migration | `Error` | 11.41 | test_vm_life_cycle.py
   test_15_secured_to_nonsecured_vm_migration | `Error` | 74.14 | test_vm_life_cycle.py
   test_16_nonsecured_to_secured_vm_migration | `Error` | 1.27 | test_vm_life_cycle.py
   ContextSuite context=TestVmSnapshot>:setup | `Error` | 2.06 | test_vm_snapshots.py
   ContextSuite context=TestCreateVolume>:setup | `Error` | 0.00 | test_volumes.py
   ContextSuite context=TestVolumes>:setup | `Error` | 0.00 | test_volumes.py
   ContextSuite context=TestVPCRedundancy>:setup | `Error` | 0.00 | test_vpc_redundant.py
   ContextSuite context=TestVPCNics>:setup | `Error` | 0.00 | test_vpc_router_nics.py
   ContextSuite context=TestRVPCSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVPCSite2SiteVPNMultipleOptions>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVpcRemoteAccessVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   ContextSuite context=TestVpcSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
   test_disable_oobm_ha_state_ineligible | `Error` | 1513.57 | 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.

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