| 48 | |
| 49 | class InteractivePrompter: |
| 50 | def get_value(self, current_value, config_name, prompt_text=''): |
| 51 | if config_name in ( |
| 52 | 'aws_access_key_id', |
| 53 | 'aws_secret_access_key', |
| 54 | 'aws_session_token', |
| 55 | ): |
| 56 | current_value = mask_value(current_value) |
| 57 | response = compat_input(f"{prompt_text} [{current_value}]: ") |
| 58 | if not response: |
| 59 | # If the user hits enter, we return a value of None |
| 60 | # instead of an empty string. That way we can determine |
| 61 | # whether or not a value has changed. |
| 62 | response = None |
| 63 | return response |
| 64 | |
| 65 | |
| 66 | class ConfigureCommand(BasicCommand): |