Ejemplo n.º 1
0
def write_configuration(config_env):
    """
        Write the configuration file for the given environment
    """
    config_file = get_deployr_config_file()

    # Store existing config to <name>.backup
    if os.path.exists(config_file):
        shutil.move(config_file, "{}.backup".format(config_file))

    config_manager = ConfigManager(config_file)
    config_manager.setup_config_dir()
    config_manager.load_config(config_obj=GLOBAL_CONF[config_env])
    config_manager.write_config()
Ejemplo n.º 2
0
def write_configuration(config_env):
    """
        Write the configuration file for the given environment
    """
    config_file = get_deployr_config_file()

    # Store existing config to <name>.backup
    if os.path.exists(config_file):
        shutil.move(config_file, "{}.backup".format(config_file))

    config_manager = ConfigManager(config_file)
    config_manager.setup_config_dir()
    config_manager.load_config(config_obj=GLOBAL_CONF[config_env])
    config_manager.write_config()
Ejemplo n.º 3
0
def load_configuration():
    """
        Loading configuration file
    """
    config_file = get_deployr_config_file()
    config_manager = ConfigManager(config_file)
    config_manager.setup_config_dir()

    if not os.path.exists(config_file):
        config_manager.load_config(config_obj=GLOBAL_CONF[ENVIRONMENT.DEV])
        config_manager.write_config()

    config_manager.load_config_from_file()
    return config_manager.config
Ejemplo n.º 4
0
def load_configuration():
    """
        Loading configuration file
    """
    config_file = get_deployr_config_file()
    config_manager = ConfigManager(config_file)
    config_manager.setup_config_dir()

    if not os.path.exists(config_file):
        config_manager.load_config(config_obj=GLOBAL_CONF[ENVIRONMENT.DEV])
        config_manager.write_config()

    config_manager.load_config_from_file()
    return config_manager.config