ó ĦôXc@slddlmZmZmZddlmZddlmZddlm Z m Z defd„ƒYZ dS(i˙˙˙˙(t IAMRequestt AS_ACCOUNTt arg_iprofile(tAddRoleToInstanceProfile(t CreateRole(tArgtMutuallyExclusiveArgListtCreateInstanceProfilecBs°eZdZeddƒeddddddƒeedd dd d ddd ƒed ddd dddddƒƒeddddd dddƒegZd„Z d„Z RS(sCreate a new instance profilethelps+name of the new instance profile (required)s-ps--pathtdesttPaths0path for the new instance profile (default: "/")s-rs --add-roletroletroute_tos+also add a role to the new instance profiles --create-rolet create_roletactiont store_truesealso create a role with the same name and path and add it to the instance profiles-vs --verboses-print the new instance profile's ARN and GUIDc Csd}|jjdƒrq|jd}tj|d|d|jjdƒddd|jjdƒƒ}|jƒn"|jjd ƒr“|jd }n|rŝ|jjd |jd |jdƒtj|d|d|jdd|jjdƒƒ}|jƒndS( NR tInstanceProfileNametRoleNameR tpathtservice_sec2.amazonaws.comtDelegateAccountR s%adding role %s to instance profile %s( tNonetargstgetRt from_othertmaintlogtinfoR(tselft_t role_nametreq((sP/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createinstanceprofile.pyt postprocess1s$     cCsM|jjdƒrI|jdiƒjdƒGH|jdiƒjdƒGHndS(NtverbosetInstanceProfiletArntInstanceProfileId(RR(Rtresult((sP/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createinstanceprofile.pyt print_resultFsN( t__name__t __module__t DESCRIPTIONRRRRRtARGSR R&(((sP/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createinstanceprofile.pyR"s    N( teuca2ools.commands.iamRRRt/euca2ools.commands.iam.addroletoinstanceprofileRt!euca2ools.commands.iam.createroleRtrequestbuilderRRR(((sP/usr/lib/python2.7/site-packages/euca2ools/commands/iam/createinstanceprofile.pyts