ó ¡ôXc@sPddlmZmZddlmZddlmZdefd„ƒYZdS(iÿÿÿÿ(tArgtMutuallyExclusiveArgList(t ArgumentError(t EC2RequesttModifyImageAttributecBsøeZdZedddddƒeeddddd dd ƒed d dd ddddddƒedddddd!ddƒƒjƒedddddddgdd!ddƒedddddddgdd!ddƒgZd„Zd „Z RS("sModify an attribute of an imagetImageIdtmetavartIMAGEthelpsimage to modifys --descriptiontdestsDescription.ValuetDESCschange the image's descriptions-ps--product-codet ProductCodetCODEtactiontappendsIproduct code to add to the given instance-store images-ls--launch-permissiont store_truetroute_tos*grant/revoke launch permissions with -a/-rs-as--addtENTITYtdefaultsMaccount to grant launch permission, or "all" for all accountss-rs--removesSaccount to remove launch permission from, or "all" for all accountscCsa|jjdƒri}xl|jjdgƒD]U}|jdgƒ|dkrk|dji|d6ƒq.|dji|d6ƒq.Wxl|jjdgƒD]U}|jdgƒ|dkrÚ|dji|d6ƒq|dji|d6ƒqW|s td ƒ‚n||jd argument -a/--add may only be used with -l/--launch-permissionsAargument -r/--remove may only be used with -l/--launch-permission(targstgett setdefaultRRtparams(tselftlpermtentity((sO/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifyimageattribute.pyt preprocess5s&  cCsn|jjdƒr=|jd|jdd|jdfƒGHn|jjdƒr‹x9|jdD]'}|jd|jdd|fƒGHq]Wn|jjdƒrjxb|jdjd gƒD]G}x>|jƒD]0\}}|jd |jdd ||fƒGHqÊWq·Wxe|jdjd gƒD]G}x>|jƒD]0\}}|jd |jdd ||fƒGHq/WqWndS(NsDescription.Valuet descriptionRR t productcodest productCodeRRRtlaunchPermissiontADDRtREMOVE(RRttabifytNoneRtitems(R t_tcodeRt entity_typet entity_name((sO/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifyimageattribute.pyt print_resultPs$      N( t__name__t __module__t DESCRIPTIONRRR+trequiredtARGSR#R1(((sO/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifyimageattribute.pyR s&   N(trequestbuilderRRtrequestbuilder.exceptionsRteuca2ools.commands.ec2RR(((sO/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/modifyimageattribute.pyts