dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
340 stars 164 forks source link

[BUG]: Unable to complete the operation because of an invalid property TargetIds . #496

Closed noesberger closed 1 year ago

noesberger commented 1 year ago

Bug Description

We've installed the new OME Version 3.10 and are now getting an error in the module configuration_compliance_baseline Unable to complete the operation because of an invalid property TargetIds .

The Problem is the following section in the code:

    pattern = re.compile(r'(1|2|3)\.(0|1|2|3|4)\.?')
    if pattern.match(ome_version):
        payload["TargetIds"] = noncomplaint_devices
    else:
        payload["DeviceIds"] = noncomplaint_devices
    return payload

the regex is now also matching for version 3.10 and is using the TargetIds instead of DeviceIds Option. So the payload is then wrong. We have to find a better way to differenciate the versions.

Component or Module Name

configuration_compliance_baseline

Ansible Version

2.10.17

Python Version

Python 3.9

iDRAC/OME/OME-M version

Version 3.10.1 (Build 51)

Operating System

Rhel 8

Playbook Used

Logs

{ "error_info": { "error": { "code": "Base.1.0.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information.", "@Message.ExtendedInfo": [ { "MessageId": "CGEN1015", "RelatedProperties": [], "Message": "Unable to complete the operation because of an invalid property TargetIds .", "MessageArgs": [ "TargetIds" ], "Severity": "Critical", "Resolution": "Verify the identified property is valid in the message and retry the operation with valid payload." } ] } },

Steps to Reproduce

Just run the module with OME Version 3.10

Expected Behavior

no error

Actual Behavior

Unable to complete the operation because of an invalid property TargetIds .

Screenshots

No response

Additional Information

No response

anupamaloke commented 1 year ago

@noesberger, thank you for submitting this issue. Let us take a look and come back on this.

sachin-apa commented 1 year ago

@noesberger we are planning to use LooseVersion library provided by the ansible to compare the version instead of regular expression and is supported from ansible 2.12 version onwards. As per the bug report I see that you are using ansible 2.10.17 version which is pretty old. I hope you will be upgrading the ansible to the latest version.

Prerequisites defined for collection here

sachin-apa commented 1 year ago

Fixed as part of the Releases 7.6.0 PR