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    
idna / lib / python2.7 / site-packages / nova / virt / libvirt / storage / dmcrypt.pyc
Size: Mime:
ó
±EYc@s¢ddlZddlmZddlmZddlmZddlm	Z	ddl
mZeje
ƒZdZd„Zd	„Zd
„Zd„Zd„ZdS(
iÿÿÿÿN(tprocessutils(tlog(texcutils(t_LE(tutilss-dmcryptcCs|tS(sŒReturns the suffixed dmcrypt volume name.

    This is to avoid collisions with similarly named device mapper names for
    LVM volumes
    (t_dmcrypt_suffix(tbase((sV/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pytvolume_namescCs1|jdƒr)|jdƒdjtƒStSdS(s:Returns true if the path corresponds to an encrypted disk.s/dev/mappert/iN(t
startswitht
rpartitiontendswithRtFalse(tpath((sV/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pytis_encrypted(sc	Csµdd||d|dt|ƒdf}djtd„|ƒƒ}ytjd|d	t|ŒWnMtjk
r°}tj	ƒ)t
jtd
ƒi|d6|d6ƒWd
QXnXd
S(s*Sets up a dmcrypt mapping

    :param target: device mapper logical device name
    :param device: underlying block device
    :param cipher: encryption cipher string digestible by cryptsetup
    :param key_size: encryption key size
    :param key: encryption key as an array of unsigned bytes
    t
cryptsetuptcreates	--cipher=s--key-size=s--key-file=-tcSsd|S(Ns%02x((tbyte((sV/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pyt<lambda>@st
process_inputtrun_as_roots=Could not start encryption for disk %(device)s: %(exception)stdevicet	exceptionN(
tstrtjointmapRtexecutetTrueRtProcessExecutionErrorRtsave_and_reraise_exceptiontLOGterrorR(ttargetRtciphertkey_sizetkeytcmdte((sV/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pyt
create_volume0s	
	
c	Cs‰ytjdd|dtƒWnetjk
r„}|jdkrQtjdƒq…tj	ƒ"tj
tdƒi|d6ƒWdQXnXdS(	sTDeletes a dmcrypt mapping

    :param target: name of the mapped logical device
    RtremoveRis.Ignoring exit code 4, volume already destroyeds’Could not disconnect encrypted volume %(volume)s. If dm-crypt device is still active it will have to be destroyed manually for cleanup to succeed.tvolumeN(RRRRRt	exit_codeRtdebugRRR R(R!R&((sV/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pyt
delete_volumeIs
cCs/gtjdƒD]}|jdƒr|^qS(s&Function enumerates encrypted volumes.s/dev/mappers-dmcrypt(tostlistdirR(tdmdev((sV/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pytlist_volumes_s(R-toslo_concurrencyRtoslo_logRtloggingt
oslo_utilsRt	nova.i18nRtnova.virt.libvirtRt	getLoggert__name__RRRRR'R,R0(((sV/home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pyt<module>s