def worker_cmd(a_device, mp_queue, cmd='show arp'):
 identifier = '{ip}:{port}'.format(**a_device)
 return_data = {}
 try:
  net_connect = ConnectHandler(**a_device)
  output = net_connect.send_command(cmd)
  return_data[identifier] = (True, output)
 except (NetMikoTimeoutException, NetMikoAuthenticationException) as e:
  return_data[identifier] = (False, e)
 mp_queue.put(return_data)

def worker_cmd ( a_device , mp_queue , cmd = 'show arp' ) : identifier = '{ip}:{port}' . format ( ** a_device ) return_data = { } try : net_connect = ConnectHandler ( ** a_device ) output = net_connect . send_command ( cmd ) return_data [ identifier ] = ( True , output ) except ( NetMikoTimeoutException , NetMikoAuthenticationException ) as e : return_data [ identifier ] = ( False , e ) mp_queue . put ( return_data )
return a dictionary where the key is the device identifier value is (success|fail .