示例#1
0
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)
示例#2
0
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)
示例#3
0
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)
示例#4
0
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)