Ejemplo n.º 1
0
def read_rds_master_password(env_name, location):
    empty_pool = ParameterPool()
    empty_pool.put(Parameter(ParameterName.EnvironmentName,
                             env_name,
                             ParameterSource.Default))
    func_matrix = [(None, ParameterName.RdsMasterPassword, None)]
    if location is None:
        location = default_aws_credential_file_location()        
    
    read_aws_credential_file(location, empty_pool, func_matrix, empty_pool, True)
    
    return empty_pool.get_value(ParameterName.RdsMasterPassword)
Ejemplo n.º 2
0
def read_rds_master_password(env_name, location):
    empty_pool = ParameterPool()
    empty_pool.put(Parameter(ParameterName.EnvironmentName,
                             env_name,
                             ParameterSource.Default))
    func_matrix = [(None, ParameterName.RdsMasterPassword, None)]
    if location is None:
        location = default_aws_credential_file_location()        
    
    read_aws_credential_file(location, empty_pool, func_matrix, empty_pool, True)
    
    return empty_pool.get_value(ParameterName.RdsMasterPassword)
Ejemplo n.º 3
0
def main(cmdline=None):

    # Initialization
    configureLogging(quiet=False)
    log.info("EB CLI start")

    parameter_pool = ParameterPool()  # pool of all parameters
    validator = ParameterValidator()
    DefaultParameterValue.fill_default(parameter_pool)
    log.debug("Finished initialization")

    try:
        # Parse command line arguments
        cli_parse.parse(parameter_pool, cmdline)
        log.debug("Finished parsing command line arguments.")
        # TODO: set quiet level here.
        if (
            parameter_pool.has(ParameterName.Verbose)
            and parameter_pool.get_value(ParameterName.Verbose) == ServiceDefault.ENABLED
        ):
            prompt.set_level(OutputLevel.Info)
        else:
            prompt.set_level(OutputLevel.ResultOnly)

        validator.validate(parameter_pool, ParameterSource.CliArgument)
        # Compile operation queue
        queue = command.compile_operation_queue(parameter_pool.command)

    except SystemExit as ex:
        _exit(0)

    except BaseException as ex:
        print((misc.to_unicode(ex)))
        log.error(ex)
        _exit(1)

    # Execute queue
    results = []
    try:
        queue.run(parameter_pool, results)
        log.debug("Finished executing operation queue")
    except BaseException as ex:
        print((misc.to_unicode(ex)))
        log.error(ex)
        _exit(1)

    _exit(0)
Ejemplo n.º 4
0
def main(cmdline=None):

    # Initialization
    configureLogging(quiet=False)
    log.info('EB CLI start')

    parameter_pool = ParameterPool()  # pool of all parameters
    validator = ParameterValidator()
    DefaultParameterValue.fill_default(parameter_pool)
    log.debug('Finished initialization')

    try:
        # Parse command line arguments
        cli_parse.parse(parameter_pool, cmdline)
        log.debug('Finished parsing command line arguments.')
        # TODO: set quiet level here.
        if (parameter_pool.has(ParameterName.Verbose) \
                and parameter_pool.get_value(ParameterName.Verbose) == ServiceDefault.ENABLED):
            prompt.set_level(OutputLevel.Info)
        else:
            prompt.set_level(OutputLevel.ResultOnly)

        validator.validate(parameter_pool, ParameterSource.CliArgument)
        # Compile operation queue
        queue = command.compile_operation_queue(parameter_pool.command)

    except SystemExit as ex:
        _exit(0)

    except BaseException as ex:
        print((misc.to_unicode(ex)))
        log.error(ex)
        _exit(1)

    # Execute queue
    results = []
    try:
        queue.run(parameter_pool, results)
        log.debug('Finished executing operation queue')
    except BaseException as ex:
        print((misc.to_unicode(ex)))
        log.error(ex)
        _exit(1)

    _exit(0)