Juniper / ansible-junos-stdlib

Junos modules for Ansible
Apache License 2.0
306 stars 158 forks source link

fix for ping packet loss in float #686

Closed chidanandpujar closed 2 months ago

chidanandpujar commented 2 months ago

when ping packet loss value is in float then module fails with following error ValueError: invalid literal for int() with base 10: '33.3333'

Added code to read the value as float and round of the value to nearest integer.

chidanandpujar commented 2 months ago

Please find the test results:

ansible-playbook pb.juniper_junos_pmtud.yml 

PLAY [Test juniper.device.pmtud module] ***********************************************************************************************************************************

TASK [TEST 1 - Check path MTU to host DNS] ********************************************************************************************************************************
ok: [localconnectiontestcases]

TASK [Check TEST 1] *******************************************************************************************************************************************************
ok: [localconnectiontestcases] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [TEST 2 - Configure and check inet.mtu to host DNS] ******************************************************************************************************************
ok: [localconnectiontestcases]

TASK [Check TEST 2] *******************************************************************************************************************************************************
ok: [localconnectiontestcases] => {
    "changed": false,
    "msg": "All assertions passed"
}

PLAY RECAP ****************************************************************************************************************************************************************
localconnectiontestcases   : ok=4    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

# ansible-playbook pb.juniper_junos_pmtud.yml 

PLAY [Test juniper.device.pmtud module] ***********************************************************************************************************************************

TASK [TEST 1 - Check path MTU to host DNS] ********************************************************************************************************************************
ok: [pyezconnectiontestcases]

TASK [Check TEST 1] *******************************************************************************************************************************************************
ok: [pyezconnectiontestcases] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [TEST 2 - Configure and check inet.mtu to host DNS] ******************************************************************************************************************
ok: [pyezconnectiontestcases]

TASK [Check TEST 2] *******************************************************************************************************************************************************
ok: [pyezconnectiontestcases] => {
    "changed": false,
    "msg": "All assertions passed"
}

PLAY RECAP ****************************************************************************************************************************************************************
pyezconnectiontestcases    : ok=4    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0