import yaml


def load_yaml(path):
    """Wrapper to load yaml file safely."""

    try:
        with open(path, 'r') as stream:
            try:
                data = yaml.safe_load(stream)
                if data is None:
                    data = dict()
                return (True, data, '')
            except yaml.YAMLError as err:
                return (False, dict(), str(err))
    except IOError:
        return (False, dict(), 'File does not exist: '+path)