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/03/05 14:56:56 UTC

[GitHub] [cloudstack] dpassante commented on issue #3934: Zones are returned in a random order

dpassante commented on issue #3934: Zones are returned in a random order
URL: https://github.com/apache/cloudstack/issues/3934#issuecomment-595271743
 
 
   In fact, the "problem" seems to come from the fact that zones are created with the sort key 0 which has priority by default.
   
   ~~~
   +----+--------------------------------------+----------+
   | id | name                                 | sort_key |
   +----+--------------------------------------+----------+
   |  1 | Sandbox-simulator-basic              |        0 |
   |  2 | Sandbox-simulator-advanced           |        0 |
   |  3 | ansible-test-dpassante-55511421-zone |        0 |
   |  4 | ansible-test-dpassante-46776470-zone |        0 |
   +----+--------------------------------------+----------+
   ~~~
   
   The sort keys are not unique, we also have the same behavior when we assign the same rank to 2 zones from the API.
   
   Once the sorting has been done, the new zones are returned first.
   ~~~
   +----+--------------------------------------+----------+
   | id | name                                 | sort_key |
   +----+--------------------------------------+----------+
   |  1 | Sandbox-simulator-basic              |        1 |
   |  2 | Sandbox-simulator-advanced           |        2 |
   |  3 | ansible-test-dpassante-91763618-zone |        0 |
   |  4 | ansible-test-dpassante-38650808-zone |        0 |
   +----+--------------------------------------+----------+
   ~~~
   
   ~~~
   $ cs listZones |grep name
         "name": "ansible-test-dpassante-38650808-zone",
         "name": "ansible-test-dpassante-91763618-zone",
         "name": "Sandbox-simulator-basic",
         "name": "Sandbox-simulator-advanced",
   ~~~
   

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