ó ¡ôXc@s™ddlZddlZddlmZddlZddlmZddlZddl m Z m Z ddl m Z dZde efd„ƒYZdS( iÿÿÿÿN(tArg(tTabifyingMixin(t IAMRequesttarg_account_name(tCreateAccessKeys,/usr/sbin/clcadmin-assume-system-credentialst CreateAccountc Bs³eZdZeddddƒeddddd ddd ƒed d ddd ddd ƒeddd dddƒeddddd dddƒgZd„Zd„Zd„Z RS(s2[Eucalyptus cloud admin only] Create a new accounttnargst?thelpsgalso add an alias (name) to the new account (required on eucalyptus < 4.2)s-ks--create-accesskeytactiont store_truetroute_tosYalso create an access key for the new account's administrator and show its-ws--write-configs¤output access keys and region information in the form of a euca2ools.ini(5) configuration file instead of by themselves (implies -k)s-ds--domains…the DNS domain to use for region information in configuration file output (default: based on IAM URL)s-ls--set-default-users®set this user as the default user for the region in euca2ools.ini(5) configuration file output. This option is only useful when used with -w.cCs¤ytj|ƒWnŒtjjk rŸ}tjjtƒr™t |j ƒdkr™t |j dt j ƒr™d}|j|j dƒf|j d|_ n‚nXdS(Nis{0}. If a cloud controller is running, you can assume administrator credentials with eval `clcadmin-assume-system-credentials`i(Rt configuretrequestbuildert exceptionst AuthErrortostpathtexiststCLC_CRED_CHECK_FILEtlentargst isinstancetsixt string_typestformat(tselfterrtmsg((sH/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccount.pyR <s'*cCs|jjdƒs$|jjdƒr™tj|ddd|ddd|jjdƒd|jjdƒd |jjd ƒƒ}|jƒ}|j|ƒndS( Ntcreate_accesskeyt write_configtUserNametadmintDelegateAccounttAccountt AccountIdtdomaintset_default_user(RtgetRt from_othertmaintupdate(Rtresulttobjt key_result((sH/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccount.pyt postprocessHs$  cCs”|jjdƒr)|djtjƒng|j|jdiƒjdƒ|jdiƒjdƒfƒGHd|kr|ddGH|ddGHndS( NRt configfileR"t AccountNameR#t AccessKeyt AccessKeyIdtSecretAccessKey(RR&twritetsyststdoutttabify(RR*((sH/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccount.pyt print_resultSs   N( t__name__t __module__t DESCRIPTIONRRtNonetARGSR R-R7(((sH/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccount.pyR)s   (tos.pathRR4R Rtrequestbuilder.exceptionstrequestbuilder.mixinsRRteuca2ools.commands.iamRRt&euca2ools.commands.iam.createaccesskeyRRR(((sH/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createaccount.pyts