ó ¡ôXc@s€ddlZddlZddlZddlZddlmZmZddlmZddl m Z de fd„ƒYZ dS(iÿÿÿÿN(tArgtMutuallyExclusiveArgList(t ArgumentError(t STSRequestt AssumeRolecBs|eZdZeddddd4ddƒeddd d dd d ed dddƒedd dddddƒeedd ddd4ddddƒedd ddd4ddddƒƒeedd dddddƒed d ddd!d edd"ƒƒed#d d$dd%dd&ƒed'd d(dd)dd*ƒed+d d,dd-dd.ƒgZd/„Z d0„Z d1„Z d2„Z d3„Z RS(5sˆ Assume an IAM role The %(prog)s utility obtains credentials for an IAM role and outputs them in the form of shellcode that sets environment variables that allow euca2ools commands to use them. Use it inside an eval command to make this process seamless: $ eval `%(prog)s myrole` To stop using the role, use euare-releaserole(1).trolenametmetavartROLEtroute_tothelpsthe role to assumes-ds --durationtdesttDurationSecondstSECONDSttypetdefaulti„s_number of seconds the credentials should be valid for (900-3600) (default: 900)s--session-nametRoleSessionNametPATHscrole session identifier to include in the assumed role user ID (default: automatic)s-ct csh_outputtactiont store_truesfgenerate C-shell commands on stdout (default if SHELL looks like a csh-style shells-st sh_outputs‡generate Bourne shell commands on stdout (default if SHELL does not look like a csh-style shells--policy-contenttPolicytPOLICY_CONTENTs´an IAM policy further restricting what the credentials will be allowed to do. This cannot grant additional permissions.s--policy-documenttFILEsÄfile containing an IAM policy further restricting what the credentials will be allowed to do. This cannot grant additional permissions.s --external-idt ExternalIdtSTRs/external ID to use for comparison with policiess --mfa-serialt SerialNumbertMFAsMFA token serial numbers --mfa-codet TokenCodetCODEsMFA token codecCs`|j|jjdƒƒ|jd<|jjdƒs\tjjƒjdƒ}||jd•s(t_AssumeRole__print_varR"R-tNoneR,tjointsystargv(R&tresulttcreds((sE/usr/lib/python2.7/site-packages/euca2ools/commands/sts/assumerole.pyt print_resultƒs  $cCsˆ|jjdƒs@|jjdƒ rXtjddƒjdƒrX|rOd}qmd}n|rgd}nd }|jd |d |ƒGHdS( NRRtSHELLttcshssetenv {key} {val};sunsetenv {key};s{key}={val}; export {key};s unset {key};tkeytval(R R!R5R6tendswithR,(R&RXRYtfmt((sE/usr/lib/python2.7/site-packages/euca2ools/commands/sts/assumerole.pyt __print_var—s   N(t__name__t __module__t DESCRIPTIONRRNtintRtopentARGSR(RR/RTRM(((sE/usr/lib/python2.7/site-packages/euca2ools/commands/sts/assumerole.pyR%sB         ( R#R5RIRPtrequestbuilderRRtrequestbuilder.exceptionsRteuca2ools.commands.stsRR(((sE/usr/lib/python2.7/site-packages/euca2ools/commands/sts/assumerole.pyts