osa_toolkit/filesystem.py
def file_find(filename, preferred_path=None, raise_if_missing=True):
    """Return the path to an existing file, or False if no file is found.

    If no file is found and raise_if_missing is True, MissingDataSource
        will be raised.

    The file lookup will be done in the following directories:
      * ``preferred_path`` [Optional]
      * ``/etc/openstack_deploy/``

    :param filename: ``str``  Name of the file to find
    :param preferred_path: ``str`` Additional directory to look in FIRST
    :param raise_if_missing: ``bool`` Should a MissingDataSource be raised if
        the file is not found
    """

    search_paths = _get_search_paths(preferred_path, suffix=filename)

    for file_candidate in search_paths:
        if os.path.isfile(file_candidate):
            return file_candidate

    # The file was not found
    if raise_if_missing:
        raise MissingDataSource(search_paths)
    else:
        return False
Return the path to an existing file, or False if no file is found.

    If no file is found and raise_if_missing is True, MissingDataSource
        will be raised.

    The file lookup will be done in the following directories:
      * ``preferred_path`` [Optional]
      * ``/etc/openstack_deploy/``

    :param filename: ``str``  Name of the file to find
    :param preferred_path: ``str`` Additional directory to look in FIRST
    :param raise_if_missing: ``bool`` Should a MissingDataSource be raised if
        the file is not found
    
Return the path to an existing file, or False if no file is found.
If no file is found and raise_if_missing is True, MissingDataSource
will be raised.


Return the path to an existing file or False if no file is found . If no file is found and raise_if_missing is True MissingDataSource will be raised .
def file_find(filename, preferred_path=None, raise_if_missing=True):
    search_paths = _get_search_paths(preferred_path, suffix=filename)
    for file_candidate in search_paths:
        if os.path.isfile(file_candidate):
            return file_candidate
    if raise_if_missing:
        raise MissingDataSource(search_paths)
    else:
        return False
def file_find ( filename , preferred_path = None , raise_if_missing = True ) : search_paths = _get_search_paths ( preferred_path , suffix = filename ) for file_candidate in search_paths : if os . path . isfile ( file_candidate ) : return file_candidate if raise_if_missing : raise MissingDataSource ( search_paths ) else : return False
Return the path to an existing file, or False if no file is found.
Return the path to an existing file or False if no file is found .
"""Return the path to an existing file, or False if no file is found.

    If no file is found and raise_if_missing is True, MissingDataSource
        will be raised.

    The file lookup will be done in the following directories:
      * ``preferred_path`` [Optional]
      * ``/etc/openstack_deploy/``

    :param filename: ``str``  Name of the file to find
    :param preferred_path: ``str`` Additional directory to look in FIRST
    :param raise_if_missing: ``bool`` Should a MissingDataSource be raised if
        the file is not found
    """ # The file was not found
filename
``str``  Name of the file to find
` ` str ` ` Name of the file to find
preferred_path
``str`` Additional directory to look in FIRST
` ` str ` ` Additional directory to look in FIRST
raise_if_missing
``bool`` Should a MissingDataSource be raised if
the file is not found
` ` bool ` ` Should a MissingDataSource be raised if the file is not found