Bug 1806298 - hc_wizard.yml: Hostname check fails with "'>' not supported between instances of 'list' and 'int'"
Summary: hc_wizard.yml: Hostname check fails with "'>' not supported between instances...
Keywords:
Status: CLOSED DUPLICATE of bug 1789277
Alias: None
Product: cockpit-ovirt
Classification: oVirt
Component: Generic
Version: 0.14.1
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Gal Zaidman
QA Contact: SATHEESARAN
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-23 16:48 UTC by Reto Gantenbein
Modified: 2020-02-24 07:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-24 07:41:03 UTC
oVirt Team: Gluster


Attachments (Terms of Use)

Description Reto Gantenbein 2020-02-23 16:48:06 UTC
The "Run Gluster Wizard for Single Node" deployment started via Cockpit fails on the second task when validating the hostname:

TASK [Check if valid hostnames are provided] ***********************************
task path: /usr/share/cockpit/ovirt-dashboard/ansible/hc_wizard.yml:16
changed: [node1.example.com -> localhost] => (item=node1.example.com) => {"ansible_loop_var": "item", "changed": true, "cmd": ["getent", "ahosts", "node1.example.com"], "delta": "0:00:00.006430", "end": "2020-02-18 14:43:34.896793", "item": "node1.example.com", "rc": 0, "start": "2020-02-18 14:43:34.890363", "stderr": "", "stderr_lines": [], "stdout": "10.0.0.6        STREAM node1.example.com\n10.0.0.6        DGRAM  \n10.0.0.6        RAW    ", "stdout_lines": ["10.0.0.6        STREAM node1.example.com", "10.0.0.6        DGRAM  ", "10.0.0.6        RAW    "]}

TASK [Check if provided hostnames are valid] ***********************************
task path: /usr/share/cockpit/ovirt-dashboard/ansible/hc_wizard.yml:29
fatal: [node1.example.com]: FAILED! => {"msg": "The conditional check 'result.results[0]['stdout_lines'] > 0' failed. The error was: Unexpected templating type error occurred on ({% if result.results[0]['stdout_lines'] > 0 %} True {% else %} False {% endif %}): '>' not supported between instances of 'list' and 'int'"}

I'm not sure how this could ever work as there is a Ansible variable type mismatch.

This was experienced on a CentOS 8 including:
ansible-2.9.4-1.el8.noarch
cockpit-ovirt-dashboard-0.14.1-1.el8.noarch

The fix is trivial. Compare with the length of the output which is empty if the host lookup is unsuccessful:

--- /usr/share/cockpit/ovirt-dashboard/ansible/hc_wizard.yml.orig       2020-02-18 14:48:33.678471259 +0100
+++ /usr/share/cockpit/ovirt-dashboard/ansible/hc_wizard.yml    2020-02-18 14:48:55.810456470 +0100
@@ -30,7 +30,7 @@
       assert:
         that:
           - "result.results[0]['rc'] == 0"
-          - "result.results[0]['stdout_lines'] > 0"
+          - "result.results[0]['stdout_lines'] | length > 0"
         fail_msg: "The given hostname is not valid FQDN"
       when: gluster_features_fqdn_check | default(true)

Comment 1 Gal Zaidman 2020-02-24 07:41:03 UTC
Marking this as duplicate of:
https://bugzilla.redhat.com/show_bug.cgi?id=1789277
it has been fixed on:
https://gerrit.ovirt.org/#/c/106890/

*** This bug has been marked as a duplicate of bug 1789277 ***


Note You need to log in before you can comment on or make changes to this bug.