示例#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)
示例#2
0
文件: scsiutil.py 项目: xcp-ng/sm
def getuniqueserial(path):
    dev = getdev(path)
    try:
        cmd = ["md5sum"]
        txt = util.pread3(cmd, getSCSIid(path))
        return txt.split(' ')[0]
    except:
        return ''
示例#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 ''
示例#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 ''