
    VhO                     z    d dl mZmZmZ eZdZdZdZd dl	m
Z
 d dlmZmZ  G d de      Zd	 Zed
k(  r e        yy)    )absolute_importdivisionprint_functiona  
---
module: edit_fru
version_added: "1.0.0"
author:
    - WangBaoshan (@ispim)
short_description: Set fru settings
description:
   - Set fru settings on Inspur server.
notes:
   - Does not support C(check_mode).
options:
    attribute:
        description:
            - Attribute,CP is Chassis Part Number,CS is Chassis Serial,PM is Product Manufacturer,
            - PPN is Product Part Number,PS is Product Serial,PN is Product Name,PV is Product Version,
            - PAT is Product Asset Tag,BM is Board Mfg,BPN is Board Product Name,BS is Board Serial,
            - BP is Board Part Number.
        choices: ['CP', 'CS', 'PM', 'PPN', 'PS', 'PN', 'PV','PAT', 'BM', 'BPN', 'BS', 'BP']
        required: true
        type: str
    value:
        description:
            - Set the value of attribute.
        required: true
        type: str
extends_documentation_fragment:
    - inspur.ispim.ism
aA  
- name: Fru test
  hosts: ism
  connection: local
  gather_facts: no
  vars:
    ism:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Set Fru"
    inspur.ispim.edit_fru:
      attribute: "CP"
      value: "Inspur"
      provider: "{{ ism }}"

a1  
message:
    description: Messages returned after module execution.
    returned: always
    type: str
state:
    description: Status after module execution.
    returned: always
    type: str
changed:
    description: Check to see if a change was made on the device.
    returned: always
    type: bool
)AnsibleModule)ism_argument_specget_connectionc                   *    e Zd Zd Zd Zd Zd Zd Zy)UIDc                 ^    || _         d | _        | j                          t               | _        y )N)specmoduleinit_moduledictresults)selfargument_specs     i/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/inspur/ispim/plugins/modules/edit_fru.py__init__zUID.__init__R   s%    !	v    c                 <    t        | j                  d      | _        y)zInit module objectF)r   supports_check_modeN)r   r   r   r   s    r   r   zUID.init_moduleX   s     $))@r   c                     d| j                   j                  d<   t        | j                         | _        | j                  d   dk(  rd| j                  d<   y y )Nsetfru
subcommandStateSuccessTchanged)r   paramsr   r   r   s    r   run_commandzUID.run_command^   sJ    +3<(%dkk2<< I-&*DLL# .r   c                 P     | j                   j                  di | j                   y)zShow resultN )r   	exit_jsonr   r   s    r   show_resultzUID.show_resultd   s    --r   c                 D    | j                          | j                          y)WorkerN)r    r$   r   s    r   workzUID.workh   s    r   N)__name__
__module____qualname__r   r   r    r$   r'   r"   r   r   r
   r
   Q   s    @+.r   r
   c                      t        t        ddg d      t        dd            } | j                  t               t        |       }|j	                          y )NstrT)CPCSPMPPNPSPNPVPATBMBPNBSBP)typerequiredchoices)r9   r:   )	attributevalue)r   updater   r
   r'   )r   uid_objs     r   mainr@   n   sM    ED  ;F  G-M *+- GLLNr   __main__N)
__future__r   r   r   r9   __metaclass__DOCUMENTATIONEXAMPLESRETURNansible.module_utils.basicr   9ansible_collections.inspur.ispim.plugins.module_utils.ismr   r   objectr
   r@   r(   r"   r   r   <module>rJ      sU    C B<*
 5 i& : zF r   