The sort keys available in the list command should be the same, with or without --detail specified
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-ironicclient |
Fix Released
|
Medium
|
Kan |
Bug Description
The sort key used in the list command should be same no matter with or without detail argument.
For example:
kan@ubuntu-desk:~$ ironic port-list
+------
| UUID | Address |
+------
| a59a9644-
| 7684010c-
| b65aebbb-
+------
kan@ubuntu-desk:~$ ironic port-list --detail
+------
| UUID | Address | Created At | Extra | Node UUID | Updated At |
+------
| a59a9644-
| 7684010c-
| b65aebbb-
+------
kan@ubuntu-desk:~$ ironic port-list --sort-key 'Created At'
Created At is an invalid field for sorting, valid values for --sort-key are: ['uuid', 'address', 'UUID', 'Address']
kan@ubuntu-desk:~$ ironic port-list --detail --sort-key 'Created At'
+------
| UUID | Address | Created At | Extra | Node UUID | Updated At |
+------
| a59a9644-
| 7684010c-
| b65aebbb-
+------
In DB:
mysql> desc ports;
+------
| Field | Type | Null | Key | Default | Extra |
+------
| created_at | datetime | YES | | NULL | |
| updated_at | datetime | YES | | NULL | |
| id | int(11) | NO | PRI | NULL | auto_increment |
| uuid | varchar(36) | YES | UNI | NULL | |
| address | varchar(18) | YES | UNI | NULL | |
| node_id | int(11) | YES | MUL | NULL | |
| extra | text | YES | | NULL | |
+------
7 rows in set (0.01 sec)
mysql> select * from ports order by created_at;
+------
| created_at | updated_at | id | uuid | address | node_id | extra |
+------
| 2015-04-14 06:17:28 | NULL | 1 | a59a9644-
| 2015-04-14 06:17:29 | NULL | 2 | 7684010c-
| 2015-04-14 06:17:30 | NULL | 3 | b65aebbb-
+------
3 rows in set (0.00 sec)
The 'created_at' is the column within the table 'ports', so it could be used as the sort key in list command, although it is not showed in the list command without detail argument.
The list command include: chassis, node, port.
Changed in ironic: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in ironic: | |
assignee: | nobody → Zhenguo Niu (niu-zglinux) |
Changed in ironic: | |
assignee: | Zhenguo Niu (niu-zglinux) → nobody |
Changed in python-ironicclient: | |
importance: | Undecided → Medium |
Changed in python-ironicclient: | |
milestone: | none → 1.0.0 |
status: | Fix Committed → Fix Released |
seems should be addressed in ironicclient side.