예제 #1
0
def get_lvm_dev():

    output = read_cmd("pvdisplay")

    m = re.search("\s+PV Name\s+([^\s]+)\s+", output)
    if m != None:
        dev = m.group(1)
        return dev.split("/")[2]

    return None
예제 #2
0
def get_symlink_dest(link):
    cmd = "ls -l %s" % link
    out = read_cmd(cmd)
    sep = "->"
    out = out.split(sep)
    return out[1].strip()