Пример #1
0
    def set_up_credentials(self):
        given_profile = self.app.pargs.profile
        if given_profile:
            ## Profile already set at abstractController
            profile = given_profile
        else:
            profile = 'eb-cli'
            aws.set_profile(profile)

        profile = self.check_credentials(profile)

        if not initializeops.credentials_are_valid():
            initializeops.setup_credentials()
        else:
            fileoperations.write_config_setting('global', 'profile', profile)
Пример #2
0
def set_up_credentials(given_profile, given_region, interactive, force_non_interactive=False):
    if given_profile:
        # Profile already set at abstractController
        profile = given_profile
    else:
        profile = 'eb-cli'
        aws.set_profile(profile)

    profile, region = check_credentials(profile, given_profile, given_region, interactive, force_non_interactive)

    if not initializeops.credentials_are_valid():
        initializeops.setup_credentials()
    else:
        fileoperations.write_config_setting('global', 'profile', profile)

    return region
Пример #3
0
def set_up_credentials(given_profile, given_region, interactive, force_non_interactive=False):
    if given_profile:
        # Profile already set at abstractController
        profile = given_profile
    else:
        profile = 'eb-cli'
        aws.set_profile(profile)

    profile, region = check_credentials(profile, given_profile, given_region, interactive, force_non_interactive)

    if not initializeops.credentials_are_valid():
        initializeops.setup_credentials()
    else:
        fileoperations.write_config_setting('global', 'profile', profile)

    return region
Пример #4
0
    def get_old_values(self):
        if fileoperations.old_eb_config_present() and \
                not fileoperations.config_file_present():
            old_values = fileoperations.get_values_from_old_eb()
            region = old_values['region']
            access_id = old_values['access_id']
            secret_key = old_values['secret_key']
            solution_stack = old_values['platform']
            app_name = old_values['app_name']
            default_env = old_values['default_env']

            io.echo(strings['init.getvarsfromoldeb'])
            if self.region is None:
                self.region = region
            if not self.app.pargs.application_name:
                self.app.pargs.application_name = app_name
            if self.app.pargs.platform is None:
                self.app.pargs.platform = solution_stack

            initializeops.setup_credentials(access_id=access_id,
                                         secret_key=secret_key)
            return default_env

        return None
Пример #5
0
    def get_old_values(self):
        if fileoperations.old_eb_config_present() and \
                not fileoperations.config_file_present():
            old_values = fileoperations.get_values_from_old_eb()
            region = old_values['region']
            access_id = old_values['access_id']
            secret_key = old_values['secret_key']
            solution_stack = old_values['platform']
            app_name = old_values['app_name']
            default_env = old_values['default_env']

            io.echo(strings['init.getvarsfromoldeb'])
            if self.region is None:
                self.region = region
            if not self.app.pargs.application_name:
                self.app.pargs.application_name = app_name
            if self.app.pargs.platform is None:
                self.app.pargs.platform = solution_stack

            initializeops.setup_credentials(access_id=access_id,
                                            secret_key=secret_key)
            return default_env

        return None