ó ¡ôXc@stddlZddlZddlZddlmZmZddlmZddlm Z defd„ƒYZ dS(iÿÿÿÿN(tArgtMutuallyExclusiveArgList(t BaseCommand(t Euca2oolst ReleaseRolec BskeZdZeZeeddddd ddddƒed dd dd dddd ƒƒgZd „Z RS(s Release IAM role credentials The %(prog)s utility removes the credentials created by euare-assumerole(1) by outputting shellcode that deletes the environment variables it creates. Use it inside an eval command to make this process seamless: $ eval `euare-releaserole` Note that if the credentials used to initially assume the role were supplied in the form of environment variables those environment variables will need to be reset: $ source eucarcs-ctdestt csh_outputtroute_totactiont store_truethelpsfgenerate 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 shellc CsœxkdD]c}|jjd ƒsM|jjd ƒ rVtjddƒjdƒrVd}nd}|j|ƒGHqWHdGHdjdjd„tjDƒƒƒGHdS(NtAWS_ACCESS_KEY_IDtAWS_ACCESS_KEYtEC2_ACCESS_KEYtAWS_SECRET_ACCESS_KEYtAWS_SECRET_KEYtEC2_SECRET_KEYtAWS_SESSION_TOKENtAWS_SECURITY_TOKENtAWS_CREDENTIAL_EXPIRATIONt EC2_USER_IDtAWS_CREDENTIAL_FILERR tSHELLttcshs unsetenv {0};s unset {0};s5# If you can read this, rerun this program with eval:s# eval `{0}`t css|]}tj|ƒVqdS(N(tpipestquote(t.0targ((sG/usr/lib/python2.7/site-packages/euca2ools/commands/misc/releaserole.pys Os( R R RRRRRRRRR( targstgettostgetenvtendswithtformattjointsystargv(tselft_tvartfmt((sG/usr/lib/python2.7/site-packages/euca2ools/commands/misc/releaserole.pyt print_result>s   N( t__name__t __module__t DESCRIPTIONRtSUITERRtNonetARGSR,(((sG/usr/lib/python2.7/site-packages/euca2ools/commands/misc/releaserole.pyR$s( R!RR&trequestbuilderRRtrequestbuilder.commandRteuca2ools.commandsRR(((sG/usr/lib/python2.7/site-packages/euca2ools/commands/misc/releaserole.pyts