dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
335 stars 163 forks source link

[BUG]: Chassis Power PIN (ome_device_local_access_configuration) #492

Closed an0wak closed 1 year ago

an0wak commented 1 year ago

Bug Description

MX7000 OME-M GUI allows a PIN of 6 numerical digits 000000-999999. This module only allows for 6 digits as integer 100000-999999.

Component or Module Name

ome_device_local_access_configuration

Ansible Version

Ansible 2.12.10

Python Version

Python 3.9.2

iDRAC/OME/OME-M version

OME-M 1.30.10

Operating System

Debian 11.6

Playbook Used

ome_device_local_access_configuration.yml

  tasks:
    - name: Configure KVM, direct access and power button settings of the chassis using device ID.
      dellemc.openmanage.ome_device_local_access_configuration:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        device_id: 25011
        chassis_power_button:
          enable_chassis_power_button: false
          enable_lcd_override_pin: true
         disabled_button_lcd_override_pin: 123456
      tags: lac-device-id

Logs

fatal: [OMEM]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "error_info": {"error": {"@Message.ExtendedInfo": [{"Message": "Unable to set the LcdOverridePin value because the value entered is not a numeric of 6 digits.", "MessageArgs": ["6"], "MessageId": "CGEN4019", "RelatedProperties": [], "Resolution": "Enter a valid LcdOverridePin value that matches the value of pin length specified in the message to set the pin or an empty string to reset the pin, and then retry the operation. For more information about setting the LcdOverridePin values, see the OpenManageEnterprise-Modular User's Guide available on the support site.", "Severity": "Critical"}], "code": "Base.1.0.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information."}}, "msg": "HTTP Error 400: Bad Request"}

Using an empty string fatal: [OMEM]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "msg": "argument 'disabled_button_lcd_override_pin' is of type <class 'str'> found in 'chassis_power_button'. and we were unable to convert to int: <class 'str'> cannot be converted to an int"}

Steps to Reproduce

Change the value between 000000 - 099999 disabled_button_lcd_override_pin: 000000

Expected Behavior

The OME-M Web Gui allows a PIN between 000000-999999. Expected behaviour is to have value 001100 as a PIN.

Actual Behavior

The playbook errors when you try to have a PIN less than 100000 and it has a 0 in front.

Screenshots

No response

Additional Information

No response

anupamaloke commented 1 year ago

@an0wak, thank you for submitting this bug. We will check and accordingly update. From what I see in the code, the disabled_button_lcd_override_pin argument has the type defined as int and that could be a reason it might be treating 000000 as just 0. Changing the module argument type to string might fix it but we need to check the API first.

an0wak commented 1 year ago

I have tested API and that takes a "string" of 6 decimal characters

anupamaloke commented 1 year ago

@an0wak, thank you for confirming it. While we try to take a look at our end, meanwhile, could you may be try changing the argument type to str and try it once?

`

an0wak commented 1 year ago

changing it to string is not a problem - it also needs regexp check to see if they are digits... Still new to Githubs and ansibles workings.

anupamaloke commented 1 year ago

@an0wak, could you please may be try with following changes:

sachin-apa commented 1 year ago

Closing the issue as this is fixed with PR # 512 Release 8.1.0