Juniper / ansible-junos-stdlib

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

fix for issue #672 to handle float values #673

Closed chidanandpujar closed 2 months ago

chidanandpujar commented 2 months ago

for ping command response, packet loss values might of type float values, so added the code to read the value in float and round of it to nearest integer value before comparing it with acceptable_packet_loss.

chidanandpujar commented 2 months ago
TASK [Test reachability to device using do-not-fragment and rapid] ********************************************************************************************************
ok: [10.220.24.28]

TASK [Print the full test response] ***************************************************************************************************************************************
ok: [10.220.24.28] => 
  test_ping:
    acceptable_percent_loss: '50'
    changed: false
    count: '3'
    dest: x.x.x.x
    dest_ip: x.x.x.x
    do_not_fragment: false
    failed: false
    host: x.x.x.x
    interface: null
    msg: Loss 33.3333%, (Sent 3 | Received 2)
    packet_loss: '33.3333'
    packets_received: '2'
    packets_sent: '3'
    rapid: true
    routing_instance: null
    rtt_average: '104'
    rtt_maximum: '175'
    rtt_minimum: '33'
    rtt_stddev: '71'
    size: '64'
    source: null
    source_ip: null
    timeout: '120'
    ttl: null