Juniper / ansible-junos-stdlib

Junos modules for Ansible
Apache License 2.0
302 stars 156 forks source link

Updated commit_configuration API parameter for PyEZ connection. #661

Closed dineshbaburam91 closed 4 months ago

dineshbaburam91 commented 4 months ago

Issue:

PyEZ connection commit_configuration API parameter data are mismatched. So it impacts commit RPC when the commit operation is performed.

Fix:

I updated the valid parameter in commit_configuration API The output log is below.

#################
    - name: "Execute set configuration"
      config:
        load: "set"
        format: "set"
        lines: 'set system login message "Login"'
        comment: "comment"
      register: test1
      tags: [ test1 ]
May  8 04:34:23 [NETCONF] - [26690] Incoming: <?xml version="1.0" encoding="UTF-8"?><nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:6f6d5aa0-d23a-4e5e-b1cb-2fd2b080b23e"><commit-configuration><log>comment</log></commit-configuration></nc:rpc>]]>]]>
slefol commented 3 months ago

warning: there is an error in the proposed fix

-            self._pyez_conn.commit_configuration(ignore_warning, comment, timeout, confirmed, full, sync, force_sync)
+            self._pyez_conn.commit_configuration(ignore_warning=ignore_warning,
+                                                 comment=comment,
+                                                 confirm=confirmed,
+                                                 timeout=timeout,
+                                                 full=full,
+                                                 force_sync=force_sync,
+                                                 sync=sync)

the confirm parameter must be named confirmed like the commit_configuration function definition. Otherwise otherwise it raises an error "ansible.module_utils.connection.ConnectionError: Connection.commit_configuration() got an unexpected keyword argument 'confirm'"

dineshbaburam91 commented 3 months ago

My bad typo error, I will fix it.