def get_nic(module, cli):
 vrouter_name = module.params['pn_vrouter_name']
 interface_ip = module.params['pn_interface_ip']
 global VRRP_EXISTS
 show = (cli + (' vrouter-interface-show vrouter-name %s ' % vrouter_name))
 show += ('ip %s format ip,nic no-show-headers' % interface_ip)
 show = shlex.split(show)
 out = module.run_command(show)[1]
 out = out.split()
 if (len(out) > 3):
  VRRP_EXISTS = True
  return None
 else:
  nic = out[2]
  VRRP_EXISTS = False
  return nic

def get_nic ( module , cli ) : vrouter_name = module . params [ 'pn_vrouter_name' ] interface_ip = module . params [ 'pn_interface_ip' ] global VRRP_EXISTS show = ( cli + ( ' vrouter-interface-show vrouter-name %s ' % vrouter_name ) ) show += ( 'ip %s format ip,nic no-show-headers' % interface_ip ) show = shlex . split ( show ) out = module . run_command ( show ) [ 1 ] out = out . split ( ) if ( len ( out ) > 3 ) : VRRP_EXISTS = True return None else : nic = out [ 2 ] VRRP_EXISTS = False return nic
this module checks if vrrp interface can be added .