def _get_cached_requirements(requirements, saltenv):
 (req_file, senv) = salt.utils.url.parse(requirements)
 if senv:
  saltenv = senv
 if (req_file not in __salt__['cp.list_master'](saltenv)):
  return False
 cached_requirements = __salt__['cp.is_cached'](requirements, saltenv)
 if (not cached_requirements):
  cached_requirements = __salt__['cp.cache_file'](requirements, saltenv)
 if (__salt__['cp.hash_file'](requirements, saltenv) != __salt__['cp.hash_file'](cached_requirements, saltenv)):
  cached_requirements = __salt__['cp.cache_file'](requirements, saltenv)
 return cached_requirements

def _get_cached_requirements ( requirements , saltenv ) : ( req_file , senv ) = salt . utils . url . parse ( requirements ) if senv : saltenv = senv if ( req_file not in __salt__ [ 'cp.list_master' ] ( saltenv ) ) : return False cached_requirements = __salt__ [ 'cp.is_cached' ] ( requirements , saltenv ) if ( not cached_requirements ) : cached_requirements = __salt__ [ 'cp.cache_file' ] ( requirements , saltenv ) if ( __salt__ [ 'cp.hash_file' ] ( requirements , saltenv ) != __salt__ [ 'cp.hash_file' ] ( cached_requirements , saltenv ) ) : cached_requirements = __salt__ [ 'cp.cache_file' ] ( requirements , saltenv ) return cached_requirements
get the location of a cached requirements file; caching if necessary .