# 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

        with self.losetup() as losetups:
            for (pv, losetup) in losetups.losetups.items():
                if pv is first_pv:
                    continue
                vg_cmd = "vgextend -v '%s' '%s'" % (self.name, losetup.device)
                run(vg_cmd)
                logger.debug("VG with UUID %s extended with PV %s" %
                             (self.uuid, self.name))

    def losetup(self):
        class VGMultiLosetup(MultiLosetup):
            vg = None

            def __init__(self, vg):
                self.vg = vg
                MultiLosetup.__init__(self, [(pv, pv.image)
                                             for pv in self.vg.pvs])

            def __enter__(self):
                MultiLosetup.__enter__(self)
                run("vgchange -v --available y '%s'" % self.vg.name)
                return self

            def __exit__(self, type, value, traceback):
                run("sync ; vgchange -v --available n '%s'" % self.vg.name)
                MultiLosetup.__exit__(self, type, value, traceback)
        return VGMultiLosetup(self)

    def scan_lvs(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


        with self.losetup() as losetups:
            for (pv, losetup) in losetups.losetups.items():
                if pv is first_pv:
                    continue
                vg_cmd = "vgextend -v '%s' '%s'" % (self.name, losetup.device)
                run(vg_cmd)
                logger.debug("VG with UUID %s extended with PV %s" %
                             (self.uuid, self.name))

    def losetup(self):
        class VGMultiLosetup(MultiLosetup):
            vg = None

            def __init__(self, vg):
                self.vg = vg
                MultiLosetup.__init__(self, [(pv, pv.image)
                                             for pv in self.vg.pvs])

            def __enter__(self):
                MultiLosetup.__enter__(self)
                run("vgchange -v --available y '%s'" % self.vg.name)
                return self

            def __exit__(self, type, value, traceback):
                run("sync ; vgchange -v --available n '%s'" % self.vg.name)
                MultiLosetup.__exit__(self, type, value, traceback)
        return VGMultiLosetup(self)

    def scan_lvs(self):

        str_lvs = run("lvs --noheadings -o vg_name,lv_name,lv_path " +