import yaml


def load_repositories(repos_file):
    """
    Load repository yaml
    """
    if repos_file:
        try:
            file_descriptor = open(repos_file, 'r', encoding='utf-8')
        except IOError as error:
            print("Error: open file {} failed", repos_file, error)
            return None
        repos = yaml.load(file_descriptor.read(), Loader=yaml.Loader)
        return repos['repositories']
    return None