%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/states/glance.pyo

�
���^c@@sdZddlmZmZmZddlZddlZyddlmZ	e
ZWnEek
r�yddl
mZ	e
ZWq�ek
r�eZq�XnXyddlmZe
ZWnek
r�eZnXeje�Zd�Zd�Zddddd	dd
d�ZdS(uI
Managing Images in OpenStack Glance
===================================
i(tabsolute_importtprint_functiontunicode_literalsN(tUnauthorized(tHTTPUnauthorizedcC@s
to	tS(u.
    Only load if dependencies are loaded
    (tHAS_KEYSTONEt
HAS_GLANCE(((s6/usr/lib/python2.7/site-packages/salt/states/glance.pyt__virtual__$scC@s4ytdd|�}Wn/tk
r1tdfStk
rHtdfSXtjdj|��t|�tkr�t	|�dkr�d|kr�|d}nt|�tkr�|j
�n|}t	|�dkr�dd	j|�fSt	|�dkr|dd
j|�fSt	|�dkr*tdfSt�dS(
u�
    Tries to find image with given name, returns
        - image, 'Found image <name>'
        - None, 'No such image found'
        - False, 'Found more than one image with given name'
    uglance.image_listtnameukeystoneclient: Unauthorizeduglanceclient: UnauthorizeduGot images: {0}iuimagesiuNo image with name "{0}"uFound image {0}u)Found more than one image with given nameN(
t__salt__tkstone_UnauthorizedtFalsetglance_UnauthorizedtlogtdebugtformatttypetdicttlentvaluestNonetNotImplementedError(Rtimagestimages_list((s6/usr/lib/python2.7/site-packages/salt/states/glance.pyt_find_image+s"


0
$
upublicurawicC@sSi|d6id6td6dd6}dddg}	|d3krR|d3krRd}n!|d3krs|d3k	rsd}nx7t|	�d	kr�|	d
|kr�Pqv|	jd
�qvWt|�\}
}|
tkr�tdr�d3|d<n
t|d<||d<|Stj|�|
d3kr�|d3k	r�tdrJd3|d<dj	|�|d<|St
d
d|d|d|d|d|�}
tjdj	|
��iii|
dd6d6d3d6|6|d<|}x�|d
krld|
kr|
d|	krtjdj	|
d|
d��Pq�|d8}tjd�t|�\}
}|
s�t|d<|dcdj	|�d|7<|Sq�W|d
kr|
d|	krt|d<|dcddj	|	�dj	|
d�7<qnM|d3krtdr�d3|d<dd |d<nt|d<dd!|d<|S||dkrA|
d|d|dd<n|r|
d"|krc|
d"}
tds�t
d#d$|
dd|�}
n|
d"|kr�tds�t|d<ntdr�d3|d<n|dcd%j	|
d"|�7<q|d|dkr||ddd"<ni|d"6|dd<d|dkrK|
|ddd"<q|i|
d"6|dd<q|dcd&j	|�7<n|d3k	r	t
|t�s�|
d'|Ar�tds�t|d<n
d3|d<|dcd(j	|
d'|�7<q	|dcd)j	|�7<nd|
kr9|r9|
ddkrd*|
krNt
d+|
d�}
nd*|
kr�tdsqt|d<n
d3|d<|dcd,d-j	|
d�7<q6|
d*|kr�tds�t|d<n
d3|d<|dcd.j	|
d*|�7<q6|dcd/j	|�7<q9|
dd4kr9|dcd0d17<q9ntjd2j	|��|S(5u1
    Checks if given image is present with properties
    set as specified.

    An image should got through the stages 'queued', 'saving'
    before becoming 'active'. The attribute 'checksum' can
    only be checked once the image is active.
    If you don't specify 'wait_for' but 'checksum' the function
    will wait for the image to become active before comparing
    checksums. If you don't specify checksum either the function
    will return when the image reached 'saving'.
    The default timeout for both is 30 seconds.

    Supported properties:
      - visibility ('public' or 'private')
      - protected (bool)
      - checksum (string, md5sum)
      - location (URL, to copy from)
      - disk_format ('raw' (default), 'vhd', 'vhdx', 'vmdk', 'vdi', 'iso',
        'qcow2', 'aki', 'ari' or 'ami')
    unameuchangesuresultuucommentuqueuedusavinguactiveiiutestu3glance.image_present would create an image from {0}uglance.image_createRt	protectedt
visibilitytlocationtdisk_formatuCreated new image:
{0}uidunewuoldustatusu Image {0} has reached status {1}iuCreated image {0} u vanished:
u!Image didn't reach an acceptable ustate ({0}) before timeout:
u	Last status was "{0}".
u*No location to copy image from specified,
u)glance.image_present would not create oneunot creating a new image.u
visibilityuglance.image_updatetidu$"visibility" is {0}, should be {1}.
u"visibility" is correct ({0}).
u	protectedu#"protected" is {0}, should be {1}.
u"protected" is correct ({0}).
uchecksumuglance.image_showu&No checksum available for this image:
u	Image has status "{0}".u""checksum" is {0}, should be {1}.
u"checksum" is correct ({0}).
u$Checksum won't be verified as image u&hasn't reached
	 "status=active" yet.
u%glance.image_present will return: {0}N(usavinguqueued(tTrueRRtpopRRt__opts__R
RRR	ttimetsleept
isinstancetbool(RRRtchecksumRRtwait_forttimeouttrett
acceptabletimagetmsgttimert	old_value((s6/usr/lib/python2.7/site-packages/salt/states/glance.pyt
image_presentIs�

		



































(t__doc__t
__future__RRRtloggingR!tkeystoneclient.exceptionsRR
RRtImportErrort#keystoneclient.apiclient.exceptionsRtglanceclient.excRRRt	getLoggert__name__R
RRRR.(((s6/usr/lib/python2.7/site-packages/salt/states/glance.pyt<module>s.






		

Zerion Mini Shell 1.0