o .&aG@sddlZddlZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZd d lmZmZeeZd d ZGdddeZGdddeZdS)N)ProfileNotFound) compat_input) BasicCommand)AddModelCommand)ConfigureSetCommand)ConfigureGetCommand)ConfigureListCommand)ConfigFileWriter) mask_valueprofile_to_sectioncCs|dtjdS)Nzbuilding-command-table.main)registerConfigureCommand add_command)clirK/usr/lib/python3/dist-packages/awscli/customizations/configure/configure.pyregister_configure_cmd src@seZdZdddZdS)InteractivePromptercCs,|dvrt|}td||f}|sd}|S)N)aws_access_key_idaws_secret_access_keyz %s [%s]: )r r)self current_value config_name prompt_textresponserrr get_value's zInteractivePrompter.get_valueN)r)__name__ __module__ __qualname__rrrrrr%srcsneZdZdZeZdZdZde dde dde dde dgZ gd Zdfd d Zd dZddZZS)r configurez&aws configure [--profile profile-name]aTo create a new configuration:: $ aws configure AWS Access Key ID [None]: accesskey AWS Secret Access Key [None]: secretkey Default region name [None]: us-west-2 Default output format [None]: To update just the region name:: $ aws configure AWS Access Key ID [****]: AWS Secret Access Key [****]: Default region name [us-west-1]: us-west-2 Default output format [None]: list)name command_classgetsetz add-model))rzAWS Access Key ID)rzAWS Secret Access Key)regionzDefault region name)outputzDefault output formatNcs<tt|||durt}||_|durt}||_dS)N)superr__init__r _prompterr _config_writer)rsessionprompter config_writer __class__rrr*Xs zConfigureCommand.__init__c Csi}z|j}Wn tyi}Ynw|jD]\}}||}|j|||}|dur5||kr5|||<qtj |j d} |ra|jj } | || | durXt | } | |d<|j|| dSdS)N config_file __section__)_sessionget_scoped_configrVALUES_TO_PROMPTr%r+rospath expanduserget_config_variableprofile_write_out_creds_file_valuesr r, update_config) r parsed_argsparsed_globals new_valuesconfigrrr new_valueconfig_filenamer;sectionrrr _run_mainas2     zConfigureCommand._run_maincCsni}d|vr |d|d<d|vr|d|d<|r5|dur"||d<tj|jd}|j||dSdS)Nrrr3credentials_file)popr7r8r9r4r:r,r=)rr@ profile_namecredential_file_valuesshared_credentials_filenamerrrr<zs( z-ConfigureCommand._write_out_creds_file_values)NN)rrr NAMEr FROM_FILE DESCRIPTIONSYNOPSISEXAMPLESrrrr SUBCOMMANDSr6r*rEr< __classcell__rrr0rr3s r)r7loggingbotocore.exceptionsr awscli.compatrawscli.customizations.commandsr(awscli.customizations.configure.addmodelr#awscli.customizations.configure.setr#awscli.customizations.configure.getr$awscli.customizations.configure.listr&awscli.customizations.configure.writerr rr r getLoggerrloggerrobjectrrrrrrs