ó ¡ôXc@srddlZddlmZddlmZmZmZddlmZddl m Z defd„ƒYZ dS(iÿÿÿÿN(tArg(t IAMRequestt AS_ACCOUNTtarg_role(t PutRolePolicy(tbuild_iam_policyt AddRolePolicycBsÑeZdZeddƒedddddeddƒed d d d deddƒedddddddeddƒedddddddeddƒeddddddƒegZd„Zd„Z RS(!sqAdd a new policy to a role. To add more complex policies than this tool supports, see euare-roleuploadpolicy(1).thelps'role to attach the policy to (required)s-ps --policy-nametmetavartPOLICYtrequireds!name of the new policy (required)s-es--effecttchoicestAllowtDenys6whether the new policy should Allow or Deny (required)s-as--actiontdesttactionstactiontappendsLaction(s) the policy should apply to (at least one required)s-cs --resourcet resourcessNresource(s) the policy should apply to (at least one required)s-os--outputt store_trues%also display the newly-created policyc CsŒt|jd|jd|jdƒ}tj|ƒ}tj|d|jdd|jdd|d|jdƒ}|jƒ}||d<|S( NteffectRRtRoleNamet PolicyNamet policy_nametPolicyDocumenttDelegateAccount(RtargstjsontdumpsRt from_othertparamstmain(tselftpolicyt policy_doctreqtresponse((sH/usr/lib/python2.7/site-packages/euca2ools/commands/iam/addrolepolicy.pyR5s   cCs|jdr|dGHndS(NtoutputR(R(R tresult((sH/usr/lib/python2.7/site-packages/euca2ools/commands/iam/addrolepolicy.pyt print_resultBs (R R ( t__name__t __module__t DESCRIPTIONRRtTrueRtARGSRR'(((sH/usr/lib/python2.7/site-packages/euca2ools/commands/iam/addrolepolicy.pyR#s"   ( RtrequestbuilderRteuca2ools.commands.iamRRRt$euca2ools.commands.iam.putrolepolicyRteuca2ools.utilRR(((sH/usr/lib/python2.7/site-packages/euca2ools/commands/iam/addrolepolicy.pyts