# Path: os_brick/encryptors/cryptsetup.py
# LOG = logging.getLogger(__name__)
# class CryptsetupEncryptor(base.VolumeEncryptor):
#     def __init__(self, root_helper,
#                  connection_info,
#                  keymgr,
#                  execute=None,
#                  *args, **kwargs):
#     def _is_crypt_device_available(self, dev_name):
#     def _get_passphrase(self, key):
#     def _open_volume(self, passphrase, **kwargs):
#     def attach_volume(self, context, **kwargs):
#     def _close_volume(self, **kwargs):
#     def detach_volume(self, **kwargs):
# 
# Path: os_brick/privileged/rootwrap.py
# LOG = logging.getLogger(__name__)
# def custom_execute(*cmd, **kwargs):
#     def on_timeout(proc):
#     def on_execute(proc):
#     def on_completion(proc):
# def execute(*cmd, **kwargs):
# def execute_root(*cmd, **kwargs):
# def unlink_root(*links, **kwargs):


from oslo_concurrency import processutils as putils
from oslo_log import log as logging
from os_brick.encryptors import cryptsetup
from os_brick.privileged import rootwrap as priv_rootwrap
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



LOG = logging.getLogger(__name__)


def is_luks(root_helper, device, execute=None):
    """Checks if the specified device uses LUKS for encryption.

    :param device: the device to check
    :returns: true if the specified device uses LUKS; false otherwise
    """
    try:
        # check to see if the device uses LUKS: exit status is 0
        # if the device is a LUKS partition and non-zero if not
        if execute is None:

# Path: os_brick/encryptors/cryptsetup.py
# LOG = logging.getLogger(__name__)
# class CryptsetupEncryptor(base.VolumeEncryptor):
#     def __init__(self, root_helper,
#                  connection_info,
#                  keymgr,
#                  execute=None,
#                  *args, **kwargs):
#     def _is_crypt_device_available(self, dev_name):
#     def _get_passphrase(self, key):
#     def _open_volume(self, passphrase, **kwargs):
#     def attach_volume(self, context, **kwargs):
#     def _close_volume(self, **kwargs):
#     def detach_volume(self, **kwargs):
# 
# Path: os_brick/privileged/rootwrap.py
# LOG = logging.getLogger(__name__)
# def custom_execute(*cmd, **kwargs):
#     def on_timeout(proc):
#     def on_execute(proc):
#     def on_completion(proc):
# def execute(*cmd, **kwargs):
# def execute_root(*cmd, **kwargs):
# def unlink_root(*links, **kwargs):


# Path: os_brick/encryptors/luks.py
from oslo_concurrency import processutils as putils
from oslo_log import log as logging
from os_brick.encryptors import cryptsetup
from os_brick.privileged import rootwrap as priv_rootwrap

# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



LOG = logging.getLogger(__name__)


def is_luks(root_helper, device, execute=None):
    """Checks if the specified device uses LUKS for encryption.

    :param device: the device to check
    :returns: true if the specified device uses LUKS; false otherwise
    """
    try:
        # check to see if the device uses LUKS: exit status is 0
        # if the device is a LUKS partition and non-zero if not
        if execute is None:

            execute = priv_rootwrap.execute