Repository URL to install this package:
|
Version:
2.5 ▾
|
ó
±EYc @ s¢ d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l
m Z e j e
Z d Z d Z d Z d
Z d Z d Z d S(
iÿÿÿÿN( t processutils( t log( t excutils( t _LE( t utilss -dmcryptc C s | t S( s Returns the suffixed dmcrypt volume name.
This is to avoid collisions with similarly named device mapper names for
LVM volumes
( t _dmcrypt_suffix( t base( ( sV /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pyt volume_name s c C s1 | j d r) | j d d j t St Sd S( s: Returns true if the path corresponds to an encrypted disk.s /dev/mappert /i N( t
startswitht
rpartitiont endswithR t False( t path( ( sV /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pyt is_encrypted( s c C sµ d d | | d | d t | d f } d j t d | } y t j d | d t | WnM t j k
r° } t j ) t
j t d
i | d 6| d 6 Wd
QXn Xd
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
cryptsetupt creates --cipher=s --key-size=s --key-file=-t c S s d | S( Ns %02x( ( t byte( ( sV /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pyt <lambda>@ s t
process_inputt run_as_roots= Could not start encryption for disk %(device)s: %(exception)st devicet exceptionN(
t strt joint mapR t executet TrueR t ProcessExecutionErrorR t save_and_reraise_exceptiont LOGt errorR ( t targetR t ciphert key_sizet keyt cmdt e( ( sV /home/tvault/.virtenv/lib/python2.7/site-packages/nova/virt/libvirt/storage/dmcrypt.pyt
create_volume0 s
c C s y t j d d | d t Wne t j k
r } | j d k rQ t j d q
t j " t j
t d i | d 6 Wd QXn Xd S( sT Deletes a dmcrypt mapping
:param target: name of the mapped logical device
R t removeR i s. 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.t volumeN( R R R R R t exit_codeR t debugR R R R ( R! R&