def checkConfig(args): """ Command for checking the config file. Args: args (argparse.Namespace): previously parsed arguments Raises: SystemExit: 0 if config is okay, 1 if not """ force_stdout = setQuiet(args) printHeader() cfg = getConfig(args) if cli.checkConfig(cfg, crontab=not args.no_crontab): print("\nConfig %(cfg)s profile '%(profile)s' is fine." % { 'cfg': cfg._LOCAL_CONFIG_PATH, 'profile': cfg.profileName() }, file=force_stdout) sys.exit(RETURN_OK) else: print("\nConfig %(cfg)s profile '%(profile)s' has errors." % { 'cfg': cfg._LOCAL_CONFIG_PATH, 'profile': cfg.profileName() }, file=force_stdout) sys.exit(RETURN_ERR)
def checkConfig(args): """ Command for checking the config file. Args: args (argparse.Namespace): previously parsed arguments Raises: SystemExit: 0 if config is okay, 1 if not """ force_stdout = setQuiet(args) printHeader() cfg = getConfig(args) if cli.checkConfig(cfg, crontab = not args.no_crontab): print("\nConfig %(cfg)s profile '%(profile)s' is fine." % {'cfg': cfg._LOCAL_CONFIG_PATH, 'profile': cfg.profileName()}, file = force_stdout) sys.exit(RETURN_OK) else: print("\nConfig %(cfg)s profile '%(profile)s' has errors." % {'cfg': cfg._LOCAL_CONFIG_PATH, 'profile': cfg.profileName()}, file = force_stdout) sys.exit(RETURN_ERR)
def checkConfig(args): """ Command for checking the config file. args: argparse.ArgumentParser instance """ force_stdout = setQuiet(args) printHeader() cfg = getConfig(args) if cli.checkConfig(cfg, crontab = not args.no_crontab): print("\nConfig %(cfg)s profile '%(profile)s' is fine." % {'cfg': cfg._LOCAL_CONFIG_PATH, 'profile': cfg.get_profile_name()}, file = force_stdout) sys.exit(RETURN_OK) else: print("\nConfig %(cfg)s profile '%(profile)s' has errors." % {'cfg': cfg._LOCAL_CONFIG_PATH, 'profile': cfg.get_profile_name()}, file = force_stdout) sys.exit(RETURN_ERR)
def checkConfig(args): """ Command for checking the config file. args: argparse.ArgumentParser instance """ force_stdout = setQuiet(args) printHeader() cfg = getConfig(args) if cli.checkConfig(cfg, crontab=not args.no_crontab): print("\nConfig %(cfg)s profile '%(profile)s' is fine." % { 'cfg': cfg._LOCAL_CONFIG_PATH, 'profile': cfg.get_profile_name() }, file=force_stdout) sys.exit(RETURN_OK) else: print("\nConfig %(cfg)s profile '%(profile)s' has errors." % { 'cfg': cfg._LOCAL_CONFIG_PATH, 'profile': cfg.get_profile_name() }, file=force_stdout) sys.exit(RETURN_ERR)