def lv_absent(name, vgname=None):
 ret = {'changes': {}, 'comment': '', 'name': name, 'result': True}
 lvpath = '/dev/{0}/{1}'.format(vgname, name)
 if (not __salt__['lvm.lvdisplay'](lvpath)):
  ret['comment'] = 'Logical Volume {0} already absent'.format(name)
 elif __opts__['test']:
  ret['comment'] = 'Logical Volume {0} is set to be removed'.format(name)
  ret['result'] = None
  return ret
 else:
  changes = __salt__['lvm.lvremove'](name, vgname)
  if (not __salt__['lvm.lvdisplay'](lvpath)):
   ret['comment'] = 'Removed Logical Volume {0}'.format(name)
   ret['changes']['removed'] = changes
  else:
   ret['comment'] = 'Failed to remove Logical Volume {0}'.format(name)
   ret['result'] = False
 return ret

def lv_absent ( name , vgname = None ) : ret = { 'changes' : { } , 'comment' : '' , 'name' : name , 'result' : True } lvpath = '/dev/{0}/{1}' . format ( vgname , name ) if ( not __salt__ [ 'lvm.lvdisplay' ] ( lvpath ) ) : ret [ 'comment' ] = 'Logical Volume {0} already absent' . format ( name ) elif __opts__ [ 'test' ] : ret [ 'comment' ] = 'Logical Volume {0} is set to be removed' . format ( name ) ret [ 'result' ] = None return ret else : changes = __salt__ [ 'lvm.lvremove' ] ( name , vgname ) if ( not __salt__ [ 'lvm.lvdisplay' ] ( lvpath ) ) : ret [ 'comment' ] = 'Removed Logical Volume {0}' . format ( name ) ret [ 'changes' ] [ 'removed' ] = changes else : ret [ 'comment' ] = 'Failed to remove Logical Volume {0}' . format ( name ) ret [ 'result' ] = False return ret
remove a given existing logical volume from a named existing volume group name the logical volume to remove vgname the volume group name .