Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / nova / virt / images.pyc
Size: Mime:
ó
±EYc@s@dZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlZddlm
Z
dd	lmZdd
lmZddlmZejeƒZejjZejƒZejdd
dde
jƒZdd„Zed„Zed„Z d„Z!d„Z"d„Z#d„Z$dS(s
Handling of VM disk images.
iÿÿÿÿN(tprocessutils(tlog(t	fileutils(t
imageutils(tunits(t	exception(t_(timage(tutilstcpu_timeit
address_spaceicCsštjj|ƒr:tjjdkr:tjd|ƒ‚ny¡tjj|ƒrˆtjjtjj	|dƒƒrˆtjj	|dƒ}nddddd	|f}|dk	r¿|d
|f}ntjdt
|Œ\}}Wnvtjk
rS}|jdkr td
ƒi|d6|d6}ntdƒi|d6|d6}tjd|ƒ‚nX|stdƒi|d6|d6}tjd|ƒ‚ntj|ƒS(sAReturn an object containing the parsed output from qemu-img info.trbdtlocationsDiskDescriptor.xmlsroot.hdstenvsLC_ALL=CsLANG=Csqemu-imgtinfos-ftprlimiti÷ÿÿÿs?qemu-img aborted by prlimits when inspecting %(path)s : %(exp)stpathtexps0qemu-img failed to execute on %(path)s : %(exp)streasons3Failed to run qemu-img info on %(path)s : %(error)sterrorN(tosRtexiststCONFtlibvirttimages_typeRtDiskNotFoundtisdirtjointNoneRtexecutetQEMU_IMG_LIMITSRtProcessExecutionErrort	exit_codeRtInvalidDiskInfoRtQemuImgInfo(RtformattcmdtoutterrRtmsg((sE/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/images.pyt
qemu_img_info.s,%!			cCs5|dkrtdƒ‚nt|||||ƒdS(sConvert image to other format.s5convert_image without input format is a security riskN(RtRuntimeErrort_convert_image(tsourcetdestt	in_formatt
out_formattrun_as_root((sE/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/images.pyt
convert_imageRscCst||d||ƒdS(sqConvert image to other format, doing unsafe automatic input format
    detection. Do not call this function.
    N(R*R(R+R,R.R/((sE/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/images.pytconvert_image_unsafeZs
cCs¡ddd|||f}|dk	r7|d|f}nytjd||ŒWnLtjk
rœ}tdƒi|d6|d6}tjd	|d
|ƒ‚nXdS(Nsqemu-imgtconverts-Os-fR/s.Unable to convert image to %(format)s: %(exp)sR#Rtimage_idR(RRRRRRRtImageUnacceptable(R+R,R-R.R/R$RR'((sE/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/images.pyR*gs	c	Cs0tj|ƒtj||d|ƒWdQXdS(Nt	dest_path(Rtremove_path_on_errort	IMAGE_APItdownload(tcontextt
image_hrefR((sE/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/images.pytfetchsscCstj||ƒS(N(R7tget(R9R:((sE/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/images.pytget_infoxsc	CsÒd|}t|||ƒtj|ƒ£t|ƒ}|j}|dkrltjdtdƒd|ƒ‚n|j	}|dk	r´tjd|dtdƒi|d6|d6ƒ‚n|dkr¸t
jr¸d	|}tj
d
||ƒtj|ƒ¾yt|||dƒWn?tjk
rN}tjd|dtdƒi|d6ƒ‚nXtj|ƒt|ƒ}|jdkrŸtjd|dtd
ƒ|jƒ‚ntj||ƒWdQXntj||ƒWdQXdS(Ns%s.partRs'qemu-img info' parsing failed.R3s'fmt=%(fmt)s backed by: %(backing_file)stfmttbacking_filetraws%s.converteds%s was %s, converting to raws'Unable to convert image to raw: %(exp)sRs&Converted to raw, but format is now %s(R;RR6R(tfile_formatRRR4RR?Rtforce_raw_imagestLOGtdebugR0Rtunlinktrename(	R9R:Rtpath_tmptdataR>R?tstagedR((sE/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/images.pytfetch_to_raw|s@
				
	
	(%t__doc__Rtoslo_concurrencyRtoslo_logRtloggingt
oslo_utilsRRRt	nova.conftnovaRt	nova.i18nRRRt	getLoggert__name__RCtconfRtAPIR7t
ProcessLimitstGiRRR(tFalseR0R1R*R;R=RJ(((sE/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/images.pyt<module>s0	$