def _find_credentials(host):
 user_names = [__pillar__['proxy'].get('username', 'root')]
 passwords = __pillar__['proxy']['passwords']
 for user in user_names:
  for password in passwords:
   try:
    ret = salt.modules.vsphere.system_info(host=host, username=user, password=password)
   except SaltSystemExit:
    continue
   if ret:
    return (user, password)
 raise SaltSystemExit('Cannot complete login due to an incorrect user name or password.')

def _find_credentials ( host ) : user_names = [ __pillar__ [ 'proxy' ] . get ( 'username' , 'root' ) ] passwords = __pillar__ [ 'proxy' ] [ 'passwords' ] for user in user_names : for password in passwords : try : ret = salt . modules . vsphere . system_info ( host = host , username = user , password = password ) except SaltSystemExit : continue if ret : return ( user , password ) raise SaltSystemExit ( 'Cannot complete login due to an incorrect user name or password.' )
cycle through all the possible credentials and return the first one that works .