Ejemplo n.º 1
0
def setSize(path, size, confirm):
    sizeMB = size / (1024 * 1024)
    cmd = [CMD_LVRESIZE, "-L", str(sizeMB), path]
    if confirm:
        util.pread3(cmd, "y\n")
    else:
        util.pread(cmd)
Ejemplo n.º 2
0
def getuniqueserial(path):
    dev = getdev(path)
    try:
        cmd = ["md5sum"]
        txt = util.pread3(cmd, getSCSIid(path))
        return txt.split(' ')[0]
    except:
        return ''
Ejemplo n.º 3
0
def getuniqueserial(path):
    dev = getdev(path)
    output = gen_rdmfile()
    try:
        cmd = ["md5sum"]
        txt = util.pread3(cmd, getSCSIid(path))
        return txt.split(' ')[0]
    except:
        return ''
Ejemplo n.º 4
0
def getuniqueserial(path):
    dev = getdev(path)
    output = gen_rdmfile()
    try:
        cmd = ["scsi_id", "-g", "-s", "/block/%s" % dev]
        text = util.pread2(cmd)
    
        cmd = ["md5sum"]
        txt = util.pread3(cmd, text)
        return txt.split(' ')[0]
    except:
        return ''