Exemplo n.º 1
0
def resizeFsImage(img, partid, size):
    from sh import guestfish
    logger = logging.getLogger('virtimg')
    str = """add %s
             run
             resize2fs-size /dev/sda%s %dK
          """ % (img.path, partid, size)
    for line in guestfish(_in=str, _iter=True):
        logger.debug('%s: guestfish resize2fs-size: %s', line)
Exemplo n.º 2
0
def checkPartition(img, partid):
    from sh import guestfish
    logger = logging.getLogger('virtimg')
    str = """add %s
             run
             e2fsck-f /dev/sda%s
          """ % (img.path, partid)
    for line in guestfish(_in=str, _iter=True):
        logger.debug('%s: guestfish e2fsck-f: %s', img.name, line)
Exemplo n.º 3
0
 def _fish(self, *args):
     return sh.guestfish("--network", "-vx", "-d", self.name, *args)
Exemplo n.º 4
0
 def _fish(self, *args):
     return sh.guestfish("--network", "-vx", "-d", self.name, *args)