Viewing File: /usr/lib/python2.7/site-packages/euca2ools/commands/euimage/pack/profiles.pyc

ó
¡ôXc@sddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
d„Zde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(	Rtbundle_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<q»t|tjƒr|j
dƒr||d<q»t|t	ƒrŒt|idd6dd6dd6ƒ|d<|djdƒr˜|djdƒr˜tdƒ‚q˜q»tdƒ‚q»WdS(NRRsblock-device-mappingstdescriptiontplatformsvirtualization-typetArchitecturetDescriptiontPlatformtVirtualizationTypesregister: arch is requireds<register: block-device-mappings must be an associative arrayt
DeviceNametnonettruetNoDevicet	ephemeraltVirtualNamet
SnapshotIdssnapshot-idt
VolumeSizesvolume-sizetDeleteOnTerminationsdelete-on-terminationtEbss9register: block device mapping {0} requires a volume-sizes)register: unreadable block device mapping(RRRRRRtpoptNonet
isinstancetdicttitemstsixtstring_typest
startswith(RRtmappingstdevicetmapping_infotmapping((sL/usr/lib/python2.7/site-packages/euca2ools/commands/euimage/pack/profiles.pyt__load_register_argsDs>		





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||||<qqWtd	|d
d	d|d
d	jd|d
d	jjd
|d
d
d|d|jƒddd|d|jdƒdddd|}	y|	jƒ}
Wn/t	k
r}t
dj|jdƒƒ‚nXt|j
ƒ}|jdƒr7|d|d<n|jdƒrW|d|d<n|jdƒsv|j|d<ntd	|dd	d|dd	jd|dd	jjd
|dd
d|
ddd d!d"j|jƒtjjƒjd#ƒƒ|}	|	jƒ}
|
d$}t|jƒ}|g|d%<|jd&gƒ|r†x<|jƒD]+\}}|d&ji|d'6|d(6ƒqTWntd	|dd	d|dd	jd|dd	jjd
|dd
|}	|	jƒ|S(*Nt
privatekeytcerttec2certtusertbuckettlocationtkerneltramdisktservicets3tconfigtlogleveltauthtimagetprefixt
image_typetmachinet
image_sizet
show_progresstmax_pending_partsit	part_sizei s{0} is requireditKernelIdt	RamdiskIdRtec2t
ImageLocationt	manifestsR?tNames{0}-{1}s%F-%H-%m-%stimageIdt
ResourceIdR;R9R:(RBRCRDRERFRGRHRI(R/RRRRLtlogtleveltget_nvratmaintKeyErrorRtformatRRRRtdatetimetutcnowtstrftimeRRR0R<R(Rtimage_mdtservicest
image_fileobjRSRR>Rtargnametreqtbundle_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.pyt<module>s	
Back to Directory File Manager