def pn_cli(module):
 username = module.params['pn_cliusername']
 password = module.params['pn_clipassword']
 cliswitch = module.params['pn_cliswitch']
 if (username and password):
  cli = ('/usr/bin/cli --quiet --user %s:%s ' % (username, password))
 else:
  cli = '/usr/bin/cli --quiet '
 if (cliswitch == 'local'):
  cli += ' switch-local '
 else:
  cli += (' switch ' + cliswitch)
 return cli

def pn_cli ( module ) : username = module . params [ 'pn_cliusername' ] password = module . params [ 'pn_clipassword' ] cliswitch = module . params [ 'pn_cliswitch' ] if ( username and password ) : cli = ( '/usr/bin/cli --quiet --user %s:%s ' % ( username , password ) ) else : cli = '/usr/bin/cli --quiet ' if ( cliswitch == 'local' ) : cli += ' switch-local ' else : cli += ( ' switch ' + cliswitch ) return cli
this method is to generate the cli portion to launch the netvisor cli .