This repository was archived by the owner on Sep 17, 2019. It is now read-only.
This repository was archived by the owner on Sep 17, 2019. It is now read-only.
ping() method implementation is inconsistent #315
Open
Description
This is definition of the ping() method in napalm-base:
{
'success': {
'probes_sent': 5,
'packet_loss': 0,
'rtt_min': 72.158,
'rtt_max': 72.433,
'rtt_avg': 72.268,
'rtt_stddev': 0.094,
'results': [
{
'ip_address': u'1.1.1.1',
'rtt': 72.248
},
{
'ip_address': '2.2.2.2',
'rtt': 72.299
}
]
}
}
OR
{
'error': 'unknown host 8.8.8.8.8'
}
napalm-ios, napalm-nxos (SSH), napalm-eos are not implemented this way on the error case.
Also I don't think it is the right data structure. I propose we change it to the following:
{
'status': 'success' (or 'error')
'message': 'for returning error messages or other info'
'probes_sent': 5,
'packet_loss': 0,
'rtt_min': 72.158,
'rtt_max': 72.433,
'rtt_avg': 72.268,
'rtt_stddev': 0.094,
'results': [
{
'ip_address': u'1.1.1.1',
'rtt': 72.248
},
{
'ip_address': '1.1.1.1',
'rtt': 72.299
}
]
}
We also should clearly define what 'error' means i.e. all probes dropped; one probe dropped, complete failure to ping (like a DNS failure).