Comment 1 for bug 1811101

Revision history for this message
Matt Riedemann (mriedem) wrote :

Looks like you were on a py35 host, I'm having a hard time reproducing this on a py27 host, but this would likely be the issue - these keys are not sorted and coming from a dict:

https://github.com/openstack/osc-placement/blob/ffc2ee4c09089baa65702abb6926a62f2cdf9996/osc_placement/resources/inventory.py#L67

https://github.com/openstack/osc-placement/blob/ffc2ee4c09089baa65702abb6926a62f2cdf9996/osc_placement/resources/inventory.py#L316

It would be easy enough to sort those fields but yeah if you want total to come after resource_class that's a bit more tricky.

I also tried using --sort-column but it doesn't seem to have an effect:

stack@train:~$ openstack resource provider inventory list dbe783b2-8780-4bef-a758-d7a853118e25 --sort-column total
+----------------+------------------+----------+----------+-----------+----------+-------+
| resource_class | allocation_ratio | max_unit | reserved | step_size | min_unit | total |
+----------------+------------------+----------+----------+-----------+----------+-------+
| VCPU | 16.0 | 8 | 0 | 1 | 1 | 8 |
| DISK_GB | 1.0 | 193 | 0 | 1 | 1 | 193 |
| MEMORY_MB | 1.5 | 7975 | 512 | 1 | 1 | 7975 |
+----------------+------------------+----------+----------+-----------+----------+-------+