Bug #28134
closedUserData false is not displayed in image list.
Description
When an image is created with user data false, listing that image using the hammer image list doesnt show anything under USER DATA column.
How Reproducible:
-------------------
Always
Steps:
-------------------
1. Create an image in GCE CR with user data set to false.
2. List all the images in GCE CR.
- $ hammer compute-resource image list --compute-resource-id 1
Actual Behavior:
-------------------
The hammer image list shows blank for user-data image set to false.
---|---------------|------------------|---------------|---------------------|----------
ID | NAME | OPERATING SYSTEM | USERNAME | UUID | USER DATA
---|---------------|------------------|---------------|---------------------|----------
2 | gce_gceclloud | rhelcustom 7.6 | jitendracloud | 1238493266994992134 | true
1 | gceImage | rhelcustom 7.6 | jitendra | 4654324179607992309 |
---|---------------|------------------|---------------|---------------------|----------
Expected Behavior:
--------------------
Hammer listing image should show false for an image where user-data is false.
Updated by Oleh Fedorenko about 5 years ago
- Category changed from Compute resources to User experience
- Difficulty set to easy
- Triaged changed from No to Yes
This happens only for table output adapter.
The fix is quite simple:
https://github.com/theforeman/hammer-cli/blob/790653a1d9df093c1d3b89f3c3daf3cadac36760/lib/hammer_cli/output/adapter/table.rb#L91
data_for_field can return false as a value, which is ignored because of ||, thus value becomes an empty string instead of `false`.
Updated by yifat makias almost 5 years ago
- Status changed from New to Assigned
- Assignee set to yifat makias
Updated by The Foreman Bot almost 5 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/hammer-cli/pull/319 added
Updated by The Foreman Bot almost 5 years ago
- Fixed in Releases hammer-cli-0.20.0 added
Updated by yifat makias almost 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 7f067753826231509ac7ee36ee5b8c194bcd1ee7.
Updated by The Foreman Bot almost 5 years ago
- Pull request https://github.com/theforeman/hammer-cli/pull/321 added
Updated by Oleh Fedorenko almost 5 years ago
- Fixed in Releases hammer-cli-0.19.2 added