Viewing File: /usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pyc

ó
¡ôXc@s•ddlZddlZddlZddlmZd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
ed„ZdS(
iÿÿÿÿN(tEMPTYcCs™i}|jdƒ}x}|D]u}|jƒr|jƒjdƒ}t|ƒdkrv|djƒ||djƒ<q‘tjdj|ƒƒ‚qqW|S(Nt,t=iiis@invalid device mapping '{0}' (must have format 'VIRTUAL=DEVICE')(tsplittstriptlentargparsetArgumentTypeErrortformat(tmappings_as_strtmappingstmapping_strstmapping_strtbits((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pytmanifest_block_device_mappings!s
!cCsÄy|jdƒ\}}Wn)tk
rDtjdj|ƒƒ‚nXi|d6}|jƒdkrqd|d<nO|jdƒr||d<n3|jd	ƒsº|jd
ƒsº|jdƒr„|jdƒ}x#t|ƒdkrî|jd!ƒqÌWt|ƒdkrtjd
j|ƒƒ‚ni|d<|drE|d|dd<n|dršyt
|dƒ|dd<Wqštk
r–tjdj|ƒƒ‚qšXn|drð|djƒd"krÕtjdj|ƒƒ‚n|djƒ|dd<n|dr|d|dd<n|drY|ddkrDtjdj|ƒƒ‚n|d|dd<n|dsÀtjdj||ƒƒ‚qÀn<|s¨tjdj||ƒƒ‚ntjd j|ƒƒ‚|S(#sO
    Parse a block device mapping from an image registration command line.
    Rs7block device mapping "{0}" must have form DEVICE=MAPPEDt
DeviceNametnonettruetNoDevicet	ephemeraltVirtualNamessnap-svol-t:ishEBS block device mapping "{0}" must have form DEVICE=[SNAP-ID]:[GiB]:[true|false]:[standard|TYPE[:IOPS]]tEbsit
SnapshotIdit
VolumeSizesCsecond element of EBS block device mapping "{0}" must be an integeritfalsesIthird element of EBS block device mapping "{0}" must be "true" or "false"tDeleteOnTerminationit
VolumeTypeitstandardsZfifth element of EBS block device mapping "{0}" is not allowed with volume type "standard"tIopssrEBS block device mapping "{0}" must specify at least one element.  Use "{1}=none" to suppress an existing mapping.sTinvalid block device mapping "{0}".  Use "{1}=none" to suppress an existing mapping.s"invalid block device mapping "{0}"N(RR(Rt
ValueErrorRRRtlowert
startswithRtappendtNonetint(t
map_as_strtdevicetmappingtmap_dicttmap_bits((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pytec2_block_device_mapping0sn











cCsT|jƒjƒdkrtS|jƒjƒd
kr8tStjdj|ƒƒ‚dS(Nt0tfRtntnot1ttRtytyess'{0}' must be 'true' or 'false'(R*R+sfalseR,R-(R.R/strueR0syes(RRtFalsetTrueRRR(tbool_str((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pyt
flexible_boolqscCsyd}|jƒjdƒ}t|ƒdkre|d|kred|j|dƒd}|d }nd}|t|ƒS(Ntkmgttbiiÿÿÿÿii(RtrstripRtfindR#(tsizetsuffixests_sizet
multiplier((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pytfilesizezs"
cCsÌt|ƒdkr$tjdƒ‚n|jdƒ}i}t|ƒdkrotjdj|t|ƒƒƒ‚n6t|ƒdkr¥tjdj|t|ƒƒƒ‚nx#t|ƒdkrÊ|jd(ƒq¨W|dr*|djdƒrt|dƒd	kr|d|d
<q*tjdj|ƒƒ‚n|dr{yt|dƒ|d
<Wq“t	k
rwtjdj|ƒƒ‚q“Xntjdj|ƒƒ‚|drÜ|djdƒrÁ|d|d<qÜtjdj|ƒƒ‚n|dr÷|d|d<n|dr7|j
dgƒ|dji|dd6dd6ƒn|dr«g|djdƒD]}|rU|^qU}td„|Dƒƒsžtjdj|ƒƒ‚n||d<n|drñ|dd)krÖ|d|d!<qñtjd"j|ƒƒ‚n|d#rg|d$r tjd%j|ƒƒ‚nyt|d#ƒ|d&<Wqgt	k
rctjd'j|ƒƒ‚qgXn|d$rÈg|d$jdƒD]}|r…i|d6^q…}|j
dgƒ|dj|ƒn|S(*s¶
    Nine-part VPC network interface definition:
    [INTERFACE]:INDEX:[SUBNET]:[DESCRIPTION]:[PRIV_IP]:[GROUP1,GROUP2,...]:
    [true|false]:[SEC_IP_COUNT|:SEC_IP1,SEC_IP2,...]
    is/network interface definitions must be non-emptyRisUnetwork interface definition "{0}" must consist of at least 2 elements ({1} provided)i	sTnetwork interface definition "{0}" must consist of at most 9 elements ({1} provided)seni-itNetworkInterfaceIdsRfirst element of network interface definition "{0}" must be a network interface IDitDeviceIndexsGsecond element of network interface definition "{0}" must be an integersFsecond element of network interface definition "{0}" must be non-emptyssubnet-tSubnetIdsGthird element of network interface definition "{0}" must be a subnet IDitDescriptionitPrivateIpAddressestPrivateIpAddressRtPrimaryiRcss|]}|jdƒVqdS(ssg-N(R (t.0tgroup((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pys	<genexpr>Æsscsixth element of network interface definition "{0}" must refer to security groups by IDs, not namestSecurityGroupIdiRRsOseventh element of network interface definition "{0}" must be "true" or "false"iisZeighth and ninth elements of network interface definition "{0}" must not both be non-emptytSecondaryPrivateIpAddressCountsGeighth element of network interface definition "{0}" must be an integerN(struesfalse(
RRRRRR!R"R R#Rt
setdefaulttalltextend(tiface_as_strR
tifacetbittgroupstaddrtsec_ips((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pyt
vpc_interface…s’
)





,





0cCs<|dkrtjjƒSt|ƒ}|jƒSWdQXdS(Nt-(tsyststdintreadtopen(tfilenametarg_file((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pyt
file_contentsés
cCsN|dkr"tjtjjƒƒSt|ƒ}tj|jƒƒSWdQXdS(NRT(tbase64t	b64encodeRURVRWRX(RYRZ((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pytb64encoded_file_contentsñscCs…|stdƒ‚nld|kro|jddƒ\}}|sWtdj|ƒƒ‚ni|d6|pjtd6Si|d6td6SdS(s
    Parse a tag definition from the command line.  Return a dict that depends
    on the format of the string given:

     - 'key=value': {'Key': key, 'Value': value}
     - 'key=':      {'Key': key, 'Value': EMPTY}
     - 'key':       {'Key': key, 'Value': EMPTY}
    stag must be non-emptyRistag "{0}" must include a keytKeytValueN(RRRR(ttag_strtkeytval((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pytbinary_tag_defùs	cCsKd|kr<|jddƒ\}}i|d6|p7td6Si|d6SdS(sþ
    Parse a tag definition from the command line.  Return a dict that depends
    on the format of the string given:

     - 'key=value': {'Key': key, 'Value': value}
     - 'key=':      {'Key': key, 'Value': EMPTY}
     - 'key':       {'Key': key}
    RiR_R`N(RR(RaRbRc((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pytternary_tag_def
s	cs+‡‡fd†}djˆjƒ|_|S(Ncsmt|tƒret|ƒdkreg|jˆƒD]0}t|jƒƒdkr1ˆ|jƒƒ^q1SgSdS(Ni(t
isinstancetstrRRR(tlist_as_strtitem(t	delimitert	item_type(s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pyt_delimited_lists!As{0} list(Rt__name__(RjRkRl((RjRks?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pytdelimited_lists(RR\RUtrequestbuilderRRR)R5R>RSR[R^RdReRgRn(((s?/usr/lib/python2.7/site-packages/euca2ools/commands/argtypes.pyt<module>s		A				d				
Back to Directory File Manager