munkireport_parser.py
def parse_config(config_file):
    """Parse and check provided configuration file"""
    try:
        config = yaml.load(config_file, Loader=yaml.SafeLoader)
        for member in CONFIG_REQUIRED_PARAMETERS:
            if member not in config:
                raise MunkiParseError(
                    "'{}' parameter is missing in the config".format(member)
                )
        return config

    except yaml.error.YAMLError as e:
        print("Failed to load YAML config: {}".format(e), file=sys.stderr)
        sys.exit(1)

    except MunkiParseError as e:
        print(str(e), file=sys.stderr)
        sys.exit(1)
Parse and check provided configuration file
Parse and check provided configuration file
Parse and check provided configuration file
def parse_config(config_file):
    try:
        config = yaml.load(config_file, Loader=yaml.SafeLoader)
        for member in CONFIG_REQUIRED_PARAMETERS:
            if member not in config:
                raise MunkiParseError(
                    "'{}' parameter is missing in the config".format(member)
                )
        return config
    except yaml.error.YAMLError as e:
        print("Failed to load YAML config: {}".format(e), file=sys.stderr)
        sys.exit(1)
    except MunkiParseError as e:
        print(str(e), file=sys.stderr)
        sys.exit(1)
def parse_config ( config_file ) : try : config = yaml . load ( config_file , Loader = yaml . SafeLoader ) for member in CONFIG_REQUIRED_PARAMETERS : if member not in config : raise MunkiParseError ( "'{}' parameter is missing in the config" . format ( member ) ) return config except yaml . error . YAMLError as e : print ( "Failed to load YAML config: {}" . format ( e ) , file = sys . stderr ) sys . exit ( 1 ) except MunkiParseError as e : print ( str ( e ) , file = sys . stderr ) sys . exit ( 1 )
Parse and check provided configuration file
Parse and check provided configuration file
"""Parse and check provided configuration file"""
config_file