def remove_volumes(paths): """Remove one or more logical volume.""" errors = [] for path in paths: clear_volume(path) try: nova.privsep.fs.lvremove(path) except processutils.ProcessExecutionError as exp: errors.append(str(exp)) if errors: raise exception.VolumesNotRemoved(reason=(', ').join(errors))
def remove_volumes(paths): """Remove one or more logical volume.""" errors = [] for path in paths: clear_volume(path) lvremove = ('lvremove', '-f', path) try: utils.execute(*lvremove, attempts=3, run_as_root=True) except processutils.ProcessExecutionError as exp: errors.append(six.text_type(exp)) if errors: raise exception.VolumesNotRemoved(reason=(', ').join(errors))