ó ¡ôXc@sddlZddlZddlmZddlmZddlmZddlm Z m Z d„Z de fd„ƒYZ dS( iÿÿÿÿN(tBundleAndUploadImage(t CreateTags(t RegisterImage(tcheck_dict_whitelistttransform_dictcCsd|krt||ƒSdS(së This is a factory method that takes a dict with image profile information and returns a profile object. While it currently always returns instance-store images, it is meant to handle multiple types in the future. tbundleN(tInstanceStoreImageProfile(t profile_dicttarch((sL/usr/lib/python2.7/site-packages/euca2ools/commands/euimage/pack/profiles.pytbuild_image_profile#s RcBs8eZd„Zd„Zd„Zd„Zdd„ZRS(cCs»t|dddddgƒi|_i|_i|_|jdƒpIi}|jd|ƒ|j|ƒ|jdƒp{i}|jd|ƒ|j|ƒ|j|jdƒp³iƒdS(NtprofileRtprovidestregisterttagR( Rt bundle_argst register_argsttag_argstgett setdefaultt,_InstanceStoreImageProfile__load_bundle_argst._InstanceStoreImageProfile__load_register_argst)_InstanceStoreImageProfile__load_tag_args(tselfRRRR((sL/usr/lib/python2.7/site-packages/euca2ools/commands/euimage/pack/profiles.pyt__init__/s      cCsHt|ddgƒ|jj|ƒ|jjdƒsDtdƒ‚ndS(NRRsregister: arch is required(RRtupdateRt ValueError(Rtargs((sL/usr/lib/python2.7/site-packages/euca2ools/commands/euimage/pack/profiles.pyt__load_bundle_args>scCs t|ddddddgƒ|jjt|idd6dd6d d6d d6ƒƒ|jjdƒsutd ƒ‚n|jjddƒpi}t|t ƒs®td ƒ‚nxë|j ƒD]Ý\}}i|d 6}|dkríd|d          cCst|dƒg}x5|jƒD]'\}}|ji|d6|d6ƒq W|r{|jjdgƒ|jdj|ƒndS(NR tKeytValuetTag(RR0tappendRRtextend(RRttagstkeytval((sL/usr/lib/python2.7/site-packages/euca2ools/commands/euimage/pack/profiles.pyt__load_tag_argshs cCsát|jƒ}x.d)D]&}|j|ƒr||||Rtargnametreqt bundle_infoterrRtregister_responsetimage_idRR?R@((sL/usr/lib/python2.7/site-packages/euca2ools/commands/euimage/pack/profiles.pytinstallqsd        & N(t__name__t __module__RRRRR-Rq(((sL/usr/lib/python2.7/site-packages/euca2ools/commands/euimage/pack/profiles.pyR.s    $ (ReR1t.euca2ools.commands.bundle.bundleanduploadimageRt!euca2ools.commands.ec2.createtagsRt$euca2ools.commands.ec2.registerimageRteuca2ools.utilRRR tobjectR(((sL/usr/lib/python2.7/site-packages/euca2ools/commands/euimage/pack/profiles.pyts