HEX
Server: Apache
System: Linux 162-240-236-42.bluehost.com 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: bt667 (1004)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //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