我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用botocore.exceptions.InvalidConfigError()。
def _get_role_config_values(self): # This returns the role related configuration. profiles = self._loaded_config.get('profiles', {}) try: source_profile = profiles[self._profile_name]['source_profile'] role_arn = profiles[self._profile_name]['role_arn'] mfa_serial = profiles[self._profile_name].get('mfa_serial') except KeyError as e: raise PartialCredentialsError(provider=self.METHOD, cred_var=str(e)) external_id = profiles[self._profile_name].get('external_id') role_session_name = \ profiles[self._profile_name].get('role_session_name') if source_profile not in profiles: raise InvalidConfigError( error_msg=( 'The source_profile "%s" referenced in ' 'the profile "%s" does not exist.' % ( source_profile, self._profile_name))) source_cred_values = profiles[source_profile] return { 'role_arn': role_arn, 'external_id': external_id, 'source_profile': source_profile, 'mfa_serial': mfa_serial, 'source_cred_values': source_cred_values, 'role_session_name': role_session_name }