SHA256
1
0
forked from pool/xen
OBS User unknown
2007-07-29 08:57:36 +00:00
committed by Git OBS Bridge
parent 8c81bc310e
commit 451287a11c
4 changed files with 108 additions and 3 deletions

View File

@@ -77,12 +77,13 @@ class Wholedisk:
"Class representing a whole disk that may have partitions"
def __init__(self, vdev, pdev):
"c'tor: set up"
self.is_blk = (S_ISBLK(os.stat(pdev)[ST_MODE]))
self.ldev = None
self.vdev = vdev
self.pdev = pdev
self.mapped = 0
self.partitions = []
self.pcount = 0
self.is_blk = (S_ISBLK(os.stat(pdev)[ST_MODE]))
self.pcount = self.scanpartitions()
def physdev(self):
@@ -251,11 +252,16 @@ class Partition:
mopts = ""
if fstype:
mopts += " -t %s" % fstype
mopts += " -o %s" % options
if options:
mopts += " -o %s" % options
verbose_print("mount %s '%s' %s" % (mopts, self.pdev, mtpt))
fd = os.popen("mount %s '%s' %s" % (mopts, self.pdev, mtpt))
err = fd.close()
if err:
try:
os.rmdir(mtpt)
except:
pass
raise RuntimeError("Error %i from mount %s '%s' on %s" % \
(err, mopts, self.pdev, mtpt))
self.mountpoint = mtpt