Bug #28134
UserData 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.
Associated revisions
History
#1
Updated by Oleh Fedorenko over 2 years ago
- Triaged changed from No to Yes
- Difficulty set to easy
- Category changed from Compute resources to User experience
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`.
#2
Updated by yifat makias over 2 years ago
- Assignee set to yifat makias
- Status changed from New to Assigned
#3
Updated by The Foreman Bot over 2 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/hammer-cli/pull/319 added
#4
Updated by The Foreman Bot over 2 years ago
- Fixed in Releases hammer-cli-0.20.0 added
#5
Updated by yifat makias over 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 7f067753826231509ac7ee36ee5b8c194bcd1ee7.
#6
Updated by The Foreman Bot over 2 years ago
- Pull request https://github.com/theforeman/hammer-cli/pull/321 added
#7
Updated by Oleh Fedorenko over 2 years ago
- Fixed in Releases hammer-cli-0.19.2 added
Fixes #28134 - fixed UserData false display in image list