Exemplo n.º 1
0
def lvremove(lvname):
    # check if lv exists
    if not filter(lambda x: x['name'] == lvname, lvdisplay()):
        raise errors.LVNotFoundError(
            'Error while removing lv: lv %s not found' % lvname)
    utils.execute('lvremove', '-f', lvname, check_exit_code=[0])
Exemplo n.º 2
0
def lvremove(lvpath):
    # check if lv exists
    if not get_first_by_key_value(lvdisplay(), 'path', lvpath):
        raise errors.LVNotFoundError(
            'Error while removing lv: lv %s not found' % lvpath)
    utils.execute('lvremove', '-f', lvpath, check_exit_code=[0])