Module Import alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str FunctionDef arguments args NameParam defaults body Expr Str Return BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr Str body Return Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore TupleLoad Str Str NameLoad NameLoad BinOpAdd Str NameLoad BinOpAdd Str Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad Str attr Call NameLoad Lambda arguments args NameParam defaults BinOpMod Str NameLoad NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Expr Call AttributeLoad NameLoad attr Str Str NameLoad keyword NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body If CompareEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Str orelse With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Return ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str decorator_list
N/A N/A os oslo_concurrency processutils oslo_log log logging oslo_utils excutils nova.i18n _LE nova.virt.libvirt utils N/A LOG N/A N/A logging getLogger __name__ N/A _dmcrypt_suffix -dmcrypt volume_name N/A N/A base N/A N/A N/A Returns the suffixed dmcrypt volume name.

    This is to avoid collisions with similarly named device mapper names for
    LVM volumes
     N/A N/A base _dmcrypt_suffix N/A is_encrypted N/A N/A path N/A N/A N/A Returns true if the path corresponds to an encrypted disk. N/A N/A N/A path startswith /dev/mapper N/A N/A N/A N/A N/A N/A N/A path rpartition / N/A 2 endswith _dmcrypt_suffix N/A N/A False N/A create_volume N/A N/A target device cipher key_size key N/A N/A N/A 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
     N/A cmd N/A cryptsetup create target device N/A --cipher= cipher N/A --key-size= N/A str key_size --key-file=- N/A key N/A N/A join N/A map N/A N/A N/A byte N/A N/A %02x byte key N/A N/A N/A N/A N/A utils execute process_input key run_as_root True cmd N/A N/A N/A N/A processutils ProcessExecutionError N/A e N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE Could not start encryption for disk %(device)s: %(exception)s N/A device exception device e N/A delete_volume N/A N/A target N/A N/A N/A Deletes a dmcrypt mapping

    :param target: name of the mapped logical device
     N/A N/A N/A N/A N/A utils execute cryptsetup remove target run_as_root True N/A N/A N/A N/A processutils ProcessExecutionError N/A e N/A N/A N/A N/A e exit_code 4 N/A N/A N/A N/A LOG debug Ignoring exit code 4, volume already destroyed N/A N/A N/A N/A excutils save_and_reraise_exception N/A N/A N/A N/A LOG error N/A _LE 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. N/A volume target N/A list_volumes N/A N/A N/A N/A N/A Function enumerates encrypted volumes. N/A N/A dmdev N/A dmdev N/A N/A os listdir /dev/mapper N/A N/A dmdev endswith -dmcrypt N/A