# Path: igor/log.py
# def configure(fn):
# def backlog():
# def getLogger(name):
# 
# Path: igor/utils.py
# def run(cmd, with_retval=False):
#     import subprocess
#     logger.debug("Running: %s" % cmd)
#     child = subprocess.Popen(cmd, shell=True,
#                              stdout=subprocess.PIPE,
#                              stderr=subprocess.PIPE)
#     (stdout, stderr) = child.communicate()
#     # pylint: disable-msg=E1101
#     child.wait()
#     if stderr:
#         logger.warning(stderr)
#     r = str(stdout).strip()
#     if with_retval:
#         r = (child.returncode, str(stdout).strip())
#     # pylint: enable-msg=E1101
#     return r


from igor import log
from igor.utils import run
import os
    image = None
    uuid = None

    def __init__(self, image):
        self.image = image

    def create(self):
        if not os.path.exists(self.image):
            raise Exception("Backing image does not exist: %s" % self.image)
        with self.losetup() as losetup:
            dev = losetup.device
            run("pvcreate -ff -y -v '%s'" % dev)
            self.uuid = run("pvs --noheadings -o uuid '%s'" % dev)
            logger.debug("PV with UUID %s created on %s" %
                         (self.uuid, self.image))

    def losetup(self):
        return Losetup(self.image)


class VolumeGroup(object):
    name = None
    pvs = None
    uuid = None

    def __init__(self, name, pvs):
        self.name = name
        self.pvs = pvs

    def create_pvs(self):

# Path: igor/log.py
# def configure(fn):
# def backlog():
# def getLogger(name):
# 
# Path: igor/utils.py
# def run(cmd, with_retval=False):
#     import subprocess
#     logger.debug("Running: %s" % cmd)
#     child = subprocess.Popen(cmd, shell=True,
#                              stdout=subprocess.PIPE,
#                              stderr=subprocess.PIPE)
#     (stdout, stderr) = child.communicate()
#     # pylint: disable-msg=E1101
#     child.wait()
#     if stderr:
#         logger.warning(stderr)
#     r = str(stdout).strip()
#     if with_retval:
#         r = (child.returncode, str(stdout).strip())
#     # pylint: enable-msg=E1101
#     return r


# Path: igor/daemon/lvm.py
from igor import log
from igor.utils import run
import os

    image = None
    uuid = None

    def __init__(self, image):
        self.image = image

    def create(self):
        if not os.path.exists(self.image):
            raise Exception("Backing image does not exist: %s" % self.image)
        with self.losetup() as losetup:
            dev = losetup.device
            run("pvcreate -ff -y -v '%s'" % dev)
            self.uuid = run("pvs --noheadings -o uuid '%s'" % dev)
            logger.debug("PV with UUID %s created on %s" %
                         (self.uuid, self.image))

    def losetup(self):
        return Losetup(self.image)


class VolumeGroup(object):
    name = None
    pvs = None
    uuid = None

    def __init__(self, name, pvs):
        self.name = name
        self.pvs = pvs

    def create_pvs(self):

        first_pv = None