From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 14 Jul 2008 22:21:46 -0000 Subject: [Cluster-devel] conga ./conga.spec.in.in ricci/modules/storage ... Message-ID: <20080714222146.4763.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Branch: RHEL5 Changes by: rmccabe at sourceware.org 2008-07-14 22:21:46 Modified files: . : conga.spec.in.in ricci/modules/storage: LVM.cpp Log message: fix bz250439 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.95&r2=1.45.2.96 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.6&r2=1.7.2.7 --- conga/conga.spec.in.in 2008/07/14 21:59:09 1.45.2.95 +++ conga/conga.spec.in.in 2008/07/14 22:21:45 1.45.2.96 @@ -304,6 +304,7 @@ - Fix bz433089 (when adding multiple nodes the order is reversed.) - Fix bz441581 (Don't allow both label and device for qdisk config if only one can be specified) - Fix bz223785 (Storage 'Display Devices by' option does not work) +- Fix bz250439 (conga is unable to delete snapshot volumes) * Fri Apr 18 2008 Ryan McCabe 0.12.0-8 - Fix bz441580 (conga should install 'sg3_utils' and start service 'scsi_reserve' when scsi fencing is used) --- conga/ricci/modules/storage/LVM.cpp 2008/01/17 17:38:39 1.7.2.6 +++ conga/ricci/modules/storage/LVM.cpp 2008/07/14 22:21:46 1.7.2.7 @@ -252,7 +252,7 @@ String attrs = words[LVS_ATTR_IDX]; props.set(Variable("attrs", attrs)); - props.set(Variable("mirrored", attrs[0] == 'm')); + props.set(Variable("mirrored", attrs[0] == 'm' || attrs[0] == 'M')); // clustered String vg_attrs = words[LVS_VG_ATTR_IDX]; @@ -602,17 +602,37 @@ void LVM::lvremove(const String& path) { - vector args; - args.push_back("lvchange"); - args.push_back("-an"); - args.push_back(path); - - String out, err; - int status; - if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw command_not_found_error_msg(LVM_BIN_PATH); - if (status != 0) - throw String("Unable to deactivate LV (might be in use by other cluster nodes)"); + vector args; + args.push_back("lvchange"); + args.push_back("-an"); + args.push_back(path); + + String out, err; + int status; + + if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) + throw command_not_found_error_msg(LVM_BIN_PATH); + + if (status != 0) { + bool ignore_err = false; + + try { + Props props; + std::list > sources; + std::list > targets; + probe_vg(path, props, sources, targets); + if (props.get("snapshot").get_bool() || + props.get("mirror").get_bool()) + { + ignore_err = true; + } + } catch (...) { + ignore_err = false; + } + + if (!ignore_err) + throw String("Unable to deactivate LV (might be in use by other cluster nodes)"); + } try { args.clear();