HewlettPackard / ilo-ansible-collection

Ansible Collection and Sample Playbooks for HPE iLO
Apache License 2.0
40 stars 20 forks source link

line 1538, in create_logical_drives_with_particular_physical_drives\n File \"/tmp/ansible_ilo_storage_payload_o5ww7v9e/ansible_ilo_storage_payload.zip/ansible_collections/hpe/ilo/plugins/module_utils/ilo_oem_utils.py\", line 1253, in check_physical_drives\nTypeError: '<' not supported between instances of 'int' and 'str'\n", #29

Open ekrimi opened 4 months ago

ekrimi commented 4 months ago

Hello Team, I am getting the error below when I try to use the role create logical drive with particular physical drives, Please note that I am using the get_physical_drives in order to collect server drives details and registred into variable, which in a second task will be processed in order to collect the datadrives Location and total capacity based in a specific condition,

line 1538, in create_logical_drives_with_particular_physical_drives\n File \"/tmp/ansible_ilo_storage_payload_o5ww7v9e/ansible_ilo_storage_payload.zip/ansible_collections/hpe/ilo/plugins/module_utils/ilo_oem_utils.py\", line 1253, in check_physical_drives\nTypeError: '<' not supported between instances of 'int' and 'str'\n",

So I didn't have any issue with datadrives location variables neither on counting the disks that I will use to create the the RAID , but the error has been raised on create logical drive with particular physical drives as CapacityGB result is being rescated as string when I use the set_fact , I have confirmed that it's a normal behavior for set_facts since always recast the variable to string

using the debug: msg and after registring the count results it always end up as dict type

in both case forcing the CapacityGB variable to int using the jinja template filter | int didn't solve the issue and raise the same error above as it appears to be Variable is being cast back to String type.

Is there any way to force the type convert from string to int inside the ilo_oem_utils.py python script and avoid this

below the main playbook `

role configure_raid: `