Esempio n. 1
0
def _setting(args):  # pragma: no cover
    check = check_repo()
    if check is False:
        _repo_error()
    # Used to specifiy if config needs to be saved
    save_config = False
    loader = Loader()
    config = loader.load_config()
    if args.config_path is True:
        save_config = True
        setup_client_config_path(config)
    if args.company is True:
        save_config = True
        setup_company(config)
    if args.urls is True:
        save_config = True
        setup_urls(config)
    if args.patches is True:
        save_config = True
        setup_patches(config)
    if args.plugin is not None:
        save_config = True
        setup_plugin(args.plugin, config)
    if args.show_plugin is not None:
        print_plugin_settings(args.show_plugin, config)
    if save_config is True:
        loader.save_config(config)
        log.info('Settings update complete')
Esempio n. 2
0
def _setting(args):  # pragma: no cover
    check = check_repo()
    if check is False:
        _repo_error()
    # Used to specifiy if config needs to be saved
    save_config = False
    loader = Loader()
    config = loader.load_config()
    if args.config_path is True:
        save_config = True
        setup_client_config_path(config)
    if args.company is True:
        save_config = True
        setup_company(config)
    if args.urls is True:
        save_config = True
        setup_urls(config)
    if args.patches is True:
        save_config = True
        setup_patches(config)
    if args.plugin is not None:
        save_config = True
        setup_plugin(args.plugin, config)
    if args.show_plugin is not None:
        print_plugin_settings(args.show_plugin, config)
    if save_config is True:
        loader.save_config(config)
        log.info('Settings update complete')
Esempio n. 3
0
def _cmd_settings(*args):  # pragma: no cover
    check_repo(exit_on_error=True)

    ns = args[0]
    # Used to specifiy if config needs to be saved
    save_config = True
    cm = ConfigManager()
    config = cm.load_config()

    # Set the path of the client_config.py relative to the root of
    # the repository
    if ns.config_path is True:
        setup_client_config_path(config)

    # Change the comapny name. This will effect the file path on the end users
    # computer to place update files & meta data
    if ns.company is True:
        setup_company(config)

    # The amount of times the client retries downloads
    if ns.max_download_retries is True:
        setup_max_download_retries(config)

    # Base urls to online updates & meta data
    if ns.urls is True:
        setup_urls(config)

    # Enable/Disable binary patches
    if ns.patches is True:
        setup_patches(config)

    # Setup config for requested upload plugin
    if ns.plugin is not None:
        setup_plugin(ns.plugin, config)

    # Show list of installed upload plugins
    if ns.show_plugin is not None:
        save_config = False
        print_plugin_settings(ns.show_plugin, config)

    # If any changes have been made, save data to disk.
    if save_config is True:
        cm.save_config(config)
        log.info('Settings update complete')
Esempio n. 4
0
def _setting(args):  # pragma: no cover
    check = check_repo()
    if check is False:
        _repo_error()

    loader = Loader()
    config = loader.load_config()
    if args.company is True:
        setup_company(config)
    if args.urls is True:
        setup_urls(config)
    if args.patches is True:
        setup_patches(config)
    if args.scp is True:
        setup_scp(config)
    if args.s3 is True:
        setup_object_bucket(config)
    loader.save_config(config)
    log.info('Settings update complete')
Esempio n. 5
0
def _setting(args):  # pragma: no cover
    check_repo()
    db = Storage()
    loader = Loader(db)
    config = loader.load_config()
    if args.appname is True:
        setup_appname(config)
    if args.company is True:
        setup_company(config)
    if args.urls is True:
        setup_urls(config)
    if args.patches is True:
        setup_patches(config)
    if args.scp is True:
        setup_scp(config)
    if args.s3 is True:
        setup_object_bucket(config)
    loader.save_config(config)
    log.info('Settings update complete')
    db._sync_db()
Esempio n. 6
0
def _setting(args):  # pragma: no cover
    check_repo()
    db = Storage()
    loader = Loader(db)
    config = loader.load_config()
    if args.appname is True:
        setup_appname(config)
    if args.company is True:
        setup_company(config)
    if args.urls is True:
        setup_urls(config)
    if args.patches is True:
        setup_patches(config)
    if args.scp is True:
        setup_scp(config)
    if args.s3 is True:
        setup_object_bucket(config)
    loader.save_config(config)
    log.info('Settings update complete')
    db._sync_db()