From aef1307f19f79d2caa7e6a7c8128a1947dd9b14a Mon Sep 17 00:00:00 2001 From: Damien Date: Wed, 20 Apr 2016 18:13:24 -0700 Subject: [PATCH 1/2] Change rapid option management --- library/junos_ping | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/junos_ping b/library/junos_ping index 8abac97..93c1526 100644 --- a/library/junos_ping +++ b/library/junos_ping @@ -196,9 +196,11 @@ def main(): # Prepare parameters ping_params = dict( host=m_args['dest_ip'], - count=m_args['count'], - rapid=m_args['rapid']) + count=m_args['count']) + if m_args['rapid'] is True: + ping_params['rapid'] = 'True' + if m_args['source_ip'] is not None: ping_params['source'] = m_args['source_ip'] results['source_ip'] = m_args['source_ip'] From c59bbda153f37cc18377081e9fdee79d3e779a9d Mon Sep 17 00:00:00 2001 From: Damien Date: Wed, 20 Apr 2016 18:16:33 -0700 Subject: [PATCH 2/2] Convert count to str --- library/junos_ping | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/junos_ping b/library/junos_ping index 93c1526..7f8db7d 100644 --- a/library/junos_ping +++ b/library/junos_ping @@ -196,11 +196,11 @@ def main(): # Prepare parameters ping_params = dict( host=m_args['dest_ip'], - count=m_args['count']) + count=str(m_args['count'])) if m_args['rapid'] is True: - ping_params['rapid'] = 'True' - + ping_params['rapid'] = m_args['rapid'] + if m_args['source_ip'] is not None: ping_params['source'] = m_args['source_ip'] results['source_ip'] = m_args['source_ip']