Inconsistent Behaviour in Server List

Bug #2067081 reported by S F
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

It looks like there are discrepancies between how `openstack server list` exits/returns depending on the output format used. Notably:

- When format is anything but `table`, "Power States" are replaced with numbers instead of being the text from usual output
- When format is anything but `table`, certain error conditions will not be met and output will become strange

These issues have been seen with openstack CLI version `6.0.0`.

## Power State Replacement

When no format is specified or table is explicitly set:

```
# openstack server list -c ID -c 'Task State' -c 'Power State' -f table
+--------------------------------------+------------+-------------+
| ID | Task State | Power State |
+--------------------------------------+------------+-------------+
| 7d698ad5-f5ba-40c1-8517-f6b54ff88d02 | None | Shutdown |
| 9c0db4c9-2455-4902-a924-87db5fe6f74a | None | Running |
```

However, other outputs would return, for example:

```
# openstack server list -c ID -c 'Task State' -c 'Power State' -f value
7d698ad5-f5ba-40c1-8517-f6b54ff88d02 None 4
9c0db4c9-2455-4902-a924-87db5fe6f74a None 1

# openstack server list -c ID -c 'Task State' -c 'Power State' -f csv
"ID","Task State","Power State"
"7d698ad5-f5ba-40c1-8517-f6b54ff88d02","","4"
"9c0db4c9-2455-4902-a924-87db5fe6f74a","","1"
```

## Error Conditions Not Met

In version 5.7.0 of the CLI, to include and filter to "Power State" and "Task State" in the list output, this would require the `--long` argument:

```
# openstack server list -c ID -c 'Task State' -c 'Power State' -f value
7d698ad5-f5ba-40c1-8517-f6b54ff88d02
9c0db4c9-2455-4902-a924-87db5fe6f74a

# openstack server list -c ID -c 'Task State' -c 'Power State' -f value --long
7d698ad5-f5ba-40c1-8517-f6b54ff88d02 None 4
9c0db4c9-2455-4902-a924-87db5fe6f74a None 1
```

However, running the above command on 6.0.0 returns strange output:

```
# openstack server list -c ID -c 'Task State' -c 'Power State' -f value --long
7d698ad5-f5ba-40c1-8517-f6b54ff88d02 None 4 None 4
9c0db4c9-2455-4902-a924-87db5fe6f74a None 1 None 1
```

To debug this, I removed the formatting and this is when I saw an error:

```
# openstack server list -c ID -c 'Task State' -c 'Power State' -f table --long
Field names must be unique
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.