def load_yaml()

in source/eksfedctl/create_action.py [0:0]


def load_yaml(file_name):
    if file_name == "-":
        try:
            #config = yaml.load(sys.stdin, Loader=yaml.FullLoader)
            config = yaml.safe_load(sys.stdin)
            return config
        except yaml.YAMLError as exc:
            raise Exception(f"Error in configuration file: {exc}")
    else:
        home_folder = os.path.expanduser("~")
        file_name = file_name.replace("~", home_folder)

        try:
            with open(file_name, "r") as file:
                try:
                    #config = yaml.load(file, Loader=yaml.FullLoader)
                    config = yaml.safe_load(sys.stdin)
                    return config
                except yaml.YAMLError as exc:
                    raise Exception(f"Error in configuration file: {exc}")
        except IOError as e:
            raise Exception(e)