Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netconf_config false argument when using confirm_commit #551

Open
Dalle55 opened this issue Jun 13, 2023 · 6 comments · May be fixed by #670
Open

netconf_config false argument when using confirm_commit #551

Dalle55 opened this issue Jun 13, 2023 · 6 comments · May be fixed by #670

Comments

@Dalle55
Copy link

Dalle55 commented Jun 13, 2023

SUMMARY

Getting the following error when enabling commit with or without confirm_commit:

false, "msg": "Argument must be bytes or unicode, got 'int'"}

I have seen bug reports on the same on previous ansible version 2.9 and 2.7 - we are on 2.13

it is the waiting time specified under "commit: 10" that fails
But also fails to identify "confirm_commit: true" or "confirm_commit: yes"

ISSUE TYPE
  • Bug Report
COMPONENT NAME

netconf_config

ANSIBLE VERSION
$ ansible --version
ansible [core 2.13.4]
python version = 3.8.10
COLLECTION VERSION
Collection        Version
----------------- -------
ansible.netcommon 3.1.1

CONFIGURATION
ANSIBLE_FORCE_COLOR(/home/voldby/git/SSN-4.9/ssn-4-platform/automation/ansible/configuration/ansible.cfg) = True
DEFAULT_HOST_LIST(/home/voldby/git/SSN-4.9/ssn-4-platform/automation/ansible/configuration/ansible.cfg) = ['/home/voldby/git/SSN-4.9/network-lab-inventory/DKBB2/inventory']
DEFAULT_LOG_PATH(/home/voldby/git/SSN-4.9/ssn-4-platform/automation/ansible/configuration/ansible.cfg) = /home/voldby/git/SSN-4.9/ssn-4-platform/automation/log/ansible overrule ans>
DEFAULT_TIMEOUT(/home/voldby/git/SSN-4.9/ssn-4-platform/automation/ansible/configuration/ansible.cfg) = 5
HOST_KEY_CHECKING(/home/voldby/git/SSN-4.9/ssn-4-platform/automation/ansible/configuration/ansible.cfg) = False
OS / ENVIRONMENT

Ansible running on: Ubuntu 20.04.5 LTS
target network device: cisco IE-3300-8T2S
target firmware; 17.9.3

target network device support for confirmed_commit

urn:ietf:params:netconf:capability:confirmed-commit:1.1
urn:ietf:params:netconf:capability:confirmed-commit:1.0
urn:ietf:params:netconf:capability:candidate:1.0

STEPS TO REPRODUCE
- name: Configure /native/ip/domain
  tags:
    - ip
    - domain
  netconf_config:
    target: candidate
    format: xml
    lock: never
    commit: yes
    confirm: 10
    get_filter: "/native/ip/domain"
    content: "{{ lookup('template', 'native_ip_domain.j2') }}"
  register: result
  until: result is not failed
  retries: "{{ DEFAULT_RETRIES }}"
  delay: "{{ DEFAULT_DELAY }}"
EXPECTED RESULTS

I expected confim_commit succes

ACTUAL RESULTS
fatal: [DKBB2-SWP-WTG001-NA-SW01]: FAILED! => {"attempts": 5, "changed": false, "msg": "Argument must be bytes or unicode, got 'int'"}
@Dalle55
Copy link
Author

Dalle55 commented Jun 13, 2023

I have also tried the following:

- name: Configure devices
  tags: 
    - ip
    - domain
  netconf_config:
    get_filter: "/native/ip/domain"
    content: "{{ lookup('template', 'native_ip_domain.j2') }}"
    format: xml
    target: candidate
    lock: never
    confirm: 10
  register: result
  until: result is not failed
  retries: "{{ DEFAULT_RETRIES }}"
  delay: "{{ DEFAULT_DELAY }}"

- name: Confirm a previous commit
  tags:
    - ip
    - domain
  netconf_config:
    lock: never
    confirm_commit: yes

@Dalle55
Copy link
Author

Dalle55 commented Jun 15, 2023

Update: Tried to upgrade ansible and collections yesterday, but have the same issue:

ansible [core 2.13.10]
  config file = /home/voldby/git/SSN-4.9/ssn-4-platform/automation/ansible/configuration/ansible.cfg
  configured module search path = ['/home/voldby/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/voldby/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/voldby/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/voldby/.local/bin/ansible
  python version = 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True

Collection

# /home/voldby/.local/lib/python3.8/site-packages/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 3.1.3  

# /home/voldby/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 5.1.1

@Dalle55
Copy link
Author

Dalle55 commented Jul 26, 2023

Any updates on this? :)

Still getting:
fatal: [DKBB2-SWP-WTG001-NA-SW01]: FAILED! => {"attempts": 5, "changed": false, "msg": "Argument must be bytes or unicode, got 'int'"}

When adding "confirm: 10"

@Dalle55
Copy link
Author

Dalle55 commented Aug 7, 2023

Tried to add unicode instead of int. Now it fails because it says it cannot convert the unicode to int.

msg": "argument 'confirm' is of type <class 'ansible.parsing.yaml.objects.AnsibleUnicode'> and we were unable to convert to int: <class 'ansible.parsing.yaml.objects.AnsibleUnicode'> cannot be converted to an int"}

@Dalle55
Copy link
Author

Dalle55 commented Aug 17, 2023

You have previously fixed it for ios-xr here:
ansible-collections/cisco.iosxr#74

@Dalle55
Copy link
Author

Dalle55 commented Mar 7, 2024

BUMP - ticket still valid

@Qalthos Qalthos removed their assignment Jul 29, 2024
@rohitthakur2590 rohitthakur2590 linked a pull request Oct 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants