From mboxrd@z Thu Jan 1 00:00:00 1970 From: kupcevic@sourceware.org Date: 6 Oct 2006 03:10:17 -0000 Subject: [Cluster-devel] conga/ricci include/utils.h modules/cluster/Cl ... Message-ID: <20061006031017.13985.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 Changes by: kupcevic at sourceware.org 2006-10-06 03:10:13 Modified files: ricci/include : utils.h ricci/modules/cluster: ClusterConf.cpp ClusterStatus.cpp Clusvcadm.cpp Fence.cpp ricci/modules/rpm: PackageHandler.cpp ricci/modules/service: ServiceManager.cpp ricci/modules/storage: BD.cpp ContentFS.cpp ContentNone.cpp ExtendedFS.cpp GFS1.cpp GFS2.cpp HD.cpp LVM.cpp MountHandler.cpp SwapFS.cpp System.cpp VG.cpp mdadm_wrapper.cpp parted_wrapper.cpp ricci/ricci : Ricci.cpp Log message: ricci: informative messages on failed command executions Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/utils.h.diff?cvsroot=cluster&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterConf.cpp.diff?cvsroot=cluster&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterStatus.cpp.diff?cvsroot=cluster&r1=1.13&r2=1.14 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Clusvcadm.cpp.diff?cvsroot=cluster&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Fence.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/rpm/PackageHandler.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/service/ServiceManager.cpp.diff?cvsroot=cluster&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/BD.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ContentFS.cpp.diff?cvsroot=cluster&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ContentNone.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ExtendedFS.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/GFS1.cpp.diff?cvsroot=cluster&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/GFS2.cpp.diff?cvsroot=cluster&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/HD.cpp.diff?cvsroot=cluster&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/MountHandler.cpp.diff?cvsroot=cluster&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/SwapFS.cpp.diff?cvsroot=cluster&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/System.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/VG.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/mdadm_wrapper.cpp.diff?cvsroot=cluster&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/parted_wrapper.cpp.diff?cvsroot=cluster&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/Ricci.cpp.diff?cvsroot=cluster&r1=1.17&r2=1.18 --- conga/ricci/include/utils.h 2006/08/14 23:55:48 1.5 +++ conga/ricci/include/utils.h 2006/10/06 03:10:13 1.6 @@ -104,5 +104,11 @@ }; +inline String +command_not_found_error_msg(const String& command) +{ + return String("command \"") + command + "\" not found/not executable"; +} + #endif // utils_h --- conga/ricci/modules/cluster/ClusterConf.cpp 2006/10/05 17:38:01 1.7 +++ conga/ricci/modules/cluster/ClusterConf.cpp 2006/10/06 03:10:13 1.8 @@ -95,7 +95,7 @@ args.push_back("update"); args.push_back(tmp_path); if (utils::execute(CCS_TOOL_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(CCS_TOOL_PATH); if (status != 0) throw String("ccs_tool failed"); @@ -105,7 +105,7 @@ args.push_back("-r"); args.push_back(utils::to_string(conf_version)); if (utils::execute(CMAN_TOOL_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(CMAN_TOOL_PATH); if (status != 0) throw String("cman_tool failed"); } --- conga/ricci/modules/cluster/ClusterStatus.cpp 2006/10/05 19:24:30 1.13 +++ conga/ricci/modules/cluster/ClusterStatus.cpp 2006/10/06 03:10:13 1.14 @@ -352,7 +352,7 @@ int status; vector args; if (utils::execute(LSMOD_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LSMOD_PATH); bool cman_loaded = (out.find("cman") != out.npos); if (cman_loaded) { @@ -375,7 +375,7 @@ args.push_back("dlm"); args.push_back("cman"); if (utils::execute(MODPROBE_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(MODPROBE_PATH); if (status != 0) throw String("modprobe -r failed"); } --- conga/ricci/modules/cluster/Clusvcadm.cpp 2006/08/15 00:16:30 1.4 +++ conga/ricci/modules/cluster/Clusvcadm.cpp 2006/10/06 03:10:13 1.5 @@ -115,7 +115,7 @@ args.push_back(nodename); } if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH); if (status != 0) throw String("clusvcadm failed"); } @@ -144,7 +144,7 @@ args.push_back("-d"); args.push_back(servicename); if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH); if (status != 0) throw String("clusvcadm failed"); } @@ -182,7 +182,7 @@ args.push_back(flag); args.push_back(servicename); if (utils::execute(CLUSVCADM_TOOL_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(CLUSVCADM_TOOL_PATH); if (status != 0) throw String("clusvcadm failed"); } @@ -205,7 +205,7 @@ bool fast_available = false; // clustat -f ? args.push_back("-h"); if (utils::execute(CLUSTAT_TOOL_PATH, args, out, err, status, false)) - throw String("missing clustat"); + throw command_not_found_error_msg(CLUSTAT_TOOL_PATH); if (out.find("-f") != out.npos) fast_available = true; @@ -214,7 +214,7 @@ args.push_back("-f"); args.push_back("-x"); if (utils::execute(CLUSTAT_TOOL_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(CLUSTAT_TOOL_PATH); if (status != 0) throw String("clustat failed"); --- conga/ricci/modules/cluster/Fence.cpp 2006/08/15 00:14:45 1.3 +++ conga/ricci/modules/cluster/Fence.cpp 2006/10/06 03:10:13 1.4 @@ -43,7 +43,7 @@ args.push_back("-O"); args.push_back(nodename); if (utils::execute(FENCE_NODE_TOOL_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(FENCE_NODE_TOOL_PATH); if (status != 0) throw String("fence_node failed"); } --- conga/ricci/modules/rpm/PackageHandler.cpp 2006/09/26 00:56:13 1.6 +++ conga/ricci/modules/rpm/PackageHandler.cpp 2006/10/06 03:10:13 1.7 @@ -73,7 +73,7 @@ vector args; args.push_back("--show-channels"); if (utils::execute(UP2DATE_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(UP2DATE_PATH); if (status != 0) rhn_available = false; } @@ -99,7 +99,7 @@ vector args; args.push_back("--showall"); if (utils::execute(UP2DATE_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(UP2DATE_PATH); vector lines = utils::split(utils::strip(out), "\n"); for (vector::const_iterator iter = lines.begin(); iter != lines.end(); @@ -125,7 +125,7 @@ args.push_back("list"); args.push_back("all"); if (utils::execute(YUM_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(YUM_PATH); vector lines = utils::split(utils::strip(out), "\n"); for (vector::const_iterator iter = lines.begin(); iter != lines.end(); @@ -165,7 +165,7 @@ for (vector::size_type i=0; i lines = utils::split(utils::strip(out), "\n"); @@ -209,7 +209,7 @@ rpm++) args.push_back(*rpm); if (utils::execute(YUM_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(YUM_PATH); if (status) return false; } @@ -223,7 +223,7 @@ rpm++) args.push_back(*rpm); if (utils::execute(YUM_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(YUM_PATH); return !status; } else @@ -318,7 +318,7 @@ vector args; args.push_back("-qa"); if (utils::execute(RPM_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(RPM_PATH); if (status != 0) throw String("rpm -qa failed"); vector lines = utils::split(out, "\n"); @@ -421,7 +421,7 @@ vector args; args.push_back("-r"); if (utils::execute(UNAME_PATH, args, out, err, status, true)) - throw String("execute failed"); + throw command_not_found_error_msg(UNAME_PATH); if (status != 0) throw String("uname -r failed"); if (out.find("smp") != out.npos) { @@ -483,7 +483,7 @@ vector args; args.push_back("-r"); if (utils::execute(UNAME_PATH, args, out, err, status, true)) - throw String("execute failed"); + throw command_not_found_error_msg(UNAME_PATH); if (status != 0) throw String("uname -r failed"); if (out.find("smp") != out.npos) { --- conga/ricci/modules/service/ServiceManager.cpp 2006/08/15 00:03:27 1.4 +++ conga/ricci/modules/service/ServiceManager.cpp 2006/10/06 03:10:13 1.5 @@ -209,7 +209,7 @@ else args.push_back("off"); if (utils::execute(CHKCONFIG_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(CHKCONFIG_PATH); if (status != 0) throw String("chkconfig failed for service ") + name; } @@ -225,7 +225,7 @@ vector args; args.push_back("status"); if (utils::execute(path, args, out, err, status, false) != 0) - throw String("execute failed"); + throw command_not_found_error_msg(path); return status == 0; } @@ -243,7 +243,7 @@ else args.push_back("stop"); if (utils::execute(path, args, out, err, status, false) != 0) - throw String("execute failed"); + throw command_not_found_error_msg(path); if (status) { bool running = service_running(name); if (on) { @@ -402,7 +402,7 @@ vector args; args.push_back("--list"); if (utils::execute(CHKCONFIG_PATH, args, out, err, status, true)) - throw String("execute failed"); + throw command_not_found_error_msg(CHKCONFIG_PATH); if (status) throw String("chkconfig failed"); vector lines = utils::split(out, "\n"); --- conga/ricci/modules/storage/BD.cpp 2006/08/10 22:53:09 1.3 +++ conga/ricci/modules/storage/BD.cpp 2006/10/06 03:10:13 1.4 @@ -64,7 +64,7 @@ args.push_back("--getsize"); args.push_back(path); if (utils::execute("/sbin/blockdev", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("blockdev"); if (status != 0) throw String("blockdev failed"); out = utils::strip(out); --- conga/ricci/modules/storage/ContentFS.cpp 2006/09/26 03:02:57 1.4 +++ conga/ricci/modules/storage/ContentFS.cpp 2006/10/06 03:10:13 1.5 @@ -281,6 +281,6 @@ vector args; args.push_back(fsname); if (utils::execute("/sbin/modinfo", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("modinfo"); return !status; } --- conga/ricci/modules/storage/ContentNone.cpp 2006/08/10 22:53:09 1.3 +++ conga/ricci/modules/storage/ContentNone.cpp 2006/10/06 03:10:13 1.4 @@ -134,7 +134,7 @@ args.push_back("count=1"); if (utils::execute("/bin/dd", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("dd"); if (status) throw String("dd failed: ") + out + " " + err + " " + utils::to_string(status); } --- conga/ricci/modules/storage/ExtendedFS.cpp 2006/10/05 16:11:38 1.6 +++ conga/ricci/modules/storage/ExtendedFS.cpp 2006/10/06 03:10:13 1.7 @@ -55,7 +55,7 @@ args.push_back("-h"); args.push_back(path); if (utils::execute("/sbin/dumpe2fs", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("dumpe2fs"); if (status) throw String("dumpe2fs failed"); vector lines = utils::split(out, "\n"); @@ -154,7 +154,7 @@ String out, err; int status; if (utils::execute("/usr/sbin/ext2online", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("ext2online"); if (status) throw String("ext2online failed"); } @@ -199,7 +199,7 @@ } args.push_back(path); if (utils::execute(bin, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(bin); if (status) throw bin + " failed"; } @@ -223,14 +223,14 @@ String out, err; int status; if (utils::execute("/sbin/tune2fs", args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(); if (status) throw String("tune2fs failed"); args.clear(); args.push_back("1"); if (utils::execute("/bin/sleep", args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(); if (status) throw String("sleep failed"); @@ -272,7 +272,7 @@ args.push_back("-j"); args.push_back(path); if (utils::execute(bin, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(bin); if (status) throw bin + " failed"; _module = "ext3"; @@ -354,7 +354,7 @@ String out, err; int status; if (utils::execute(MKE2FS_path, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MKE2FS_path); if (status != 0) throw MKE2FS_path + " failed"; --- conga/ricci/modules/storage/GFS1.cpp 2006/10/05 16:11:38 1.2 +++ conga/ricci/modules/storage/GFS1.cpp 2006/10/06 03:10:13 1.3 @@ -185,7 +185,7 @@ String out, err; int status; if (utils::execute(MKFS_GFS1_path, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MKFS_GFS1_path); if (status) throw MKFS_GFS1_path + " " + path + " failed"; --- conga/ricci/modules/storage/GFS2.cpp 2006/10/05 16:11:38 1.2 +++ conga/ricci/modules/storage/GFS2.cpp 2006/10/06 03:10:13 1.3 @@ -189,7 +189,7 @@ String out, err; int status; if (utils::execute(MKFS_GFS2_path, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MKFS_GFS2_path); if (status) throw MKFS_GFS2_path + " " + path + " failed"; --- conga/ricci/modules/storage/HD.cpp 2006/08/10 22:53:09 1.4 +++ conga/ricci/modules/storage/HD.cpp 2006/10/06 03:10:13 1.5 @@ -47,7 +47,7 @@ args.push_back("--getsize"); args.push_back(path); if (utils::execute("/sbin/blockdev", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(); if (status != 0) throw String("blockdev failed"); out = utils::strip(out); @@ -67,7 +67,7 @@ args.clear(); out.clear(); args.push_back(String("/proc/ide") + path.substr(String("/dev").size()) + "/model"); if (utils::execute("/bin/cat", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("cat"); if (status == 0) { vector words = utils::split(utils::strip(out)); if (words.size() == 1) @@ -84,13 +84,13 @@ args.clear(); out.clear(); args.push_back(tmp + "vendor"); if (utils::execute("/bin/cat", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("cat"); if (status == 0) vendor = utils::strip(out); args.clear(); out.clear(); args.push_back(tmp + "model"); if (utils::execute("/bin/cat", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("cat"); if (status == 0) model = utils::strip(out); _props.set(Variable("vendor", vendor)); @@ -108,7 +108,7 @@ sys_path = "/block" + sys_path; args.push_back(sys_path); if (utils::execute("/sbin/scsi_id", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("scsi_id"); if (status == 0) { out = utils::strip(out); vector words = utils::split(out); --- conga/ricci/modules/storage/LVM.cpp 2006/08/21 15:44:42 1.6 +++ conga/ricci/modules/storage/LVM.cpp 2006/10/06 03:10:13 1.7 @@ -155,7 +155,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("lvdisplay failed"); @@ -206,7 +206,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("lvs failed"); @@ -261,7 +261,7 @@ args.push_back("-o"); args.push_back("lv_name,vg_name,origin"); if (utils::execute(LVM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("lvs failed"); vector lines = utils::split(out, "\n"); @@ -374,7 +374,7 @@ args.push_back("lvdisplay"); args.push_back("-c"); if (utils::execute(LVM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("lvdisplay failed"); vector lines = utils::split(out, "\n"); @@ -402,7 +402,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("pvcreate failed"); utils::clear_cache(); @@ -420,7 +420,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("pvremove failed"); utils::clear_cache(); @@ -452,7 +452,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("vgcreate failed"); utils::clear_cache(); @@ -468,7 +468,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("vgremove failed"); utils::clear_cache(); @@ -489,7 +489,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("vgextend failed"); utils::clear_cache(); @@ -506,7 +506,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("vgreduce failed"); utils::clear_cache(); @@ -528,7 +528,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("vgchange failed"); utils::clear_cache(); @@ -551,7 +551,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("lvcreate failed"); utils::clear_cache(); @@ -573,7 +573,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("lvcreate failed"); utils::clear_cache(); @@ -590,7 +590,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("lvremove failed"); utils::clear_cache(); @@ -611,7 +611,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("lvreduce failed"); utils::clear_cache(); @@ -631,7 +631,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status != 0) throw String("lvextend failed"); utils::clear_cache(); @@ -654,7 +654,7 @@ vector args; args.push_back("quorum"); if (utils::execute("/sbin/magma_tool", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("magma_tool"); if (status) throw String("cluster tools: magma_tool errored"); if (out.find("Quorate") == out.npos) @@ -665,7 +665,7 @@ args.push_back("clvmd"); args.push_back("start"); if (utils::execute("/sbin/service", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("service"); if (status) throw ClvmdError(); } @@ -680,7 +680,7 @@ args.push_back("locking_type"); args.push_back("/etc/lvm/lvm.conf"); if (utils::execute("/bin/grep", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("grep"); vector lines(utils::split(utils::strip(out), "\n")); for (vector::const_iterator line = lines.begin(); line != lines.end(); @@ -713,7 +713,7 @@ args.push_back(VGS_OPTIONS_STRING); // args.push_back(vgname); if (utils::execute(LVM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status) throw String("vgs failed"); @@ -760,7 +760,7 @@ args.push_back("-o"); args.push_back(PVS_OPTIONS); if (utils::execute(LVM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); bool use_pvdisplay = false; if (status) @@ -774,7 +774,7 @@ args.push_back("pvdisplay"); args.push_back("-c"); if (utils::execute(LVM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status) throw String("pvs and pvdisplay failed"); --- conga/ricci/modules/storage/MountHandler.cpp 2006/09/26 01:16:13 1.4 +++ conga/ricci/modules/storage/MountHandler.cpp 2006/10/06 03:10:13 1.5 @@ -259,7 +259,7 @@ err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(bin); return !status; } @@ -289,7 +289,7 @@ err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(bin); return !status; } @@ -601,7 +601,7 @@ err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(findfs_path); if (status != 0) throw String("unable to find path for ") + devname + " " + out + " " + err + " " + utils::to_string(status); @@ -634,7 +634,7 @@ err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg("mkdir"); if (status) throw String("creation of ") + path + " failed"; } --- conga/ricci/modules/storage/SwapFS.cpp 2006/10/05 16:11:38 1.7 +++ conga/ricci/modules/storage/SwapFS.cpp 2006/10/06 03:10:13 1.8 @@ -152,7 +152,7 @@ String out, err; int status; if (utils::execute("/sbin/mkswap", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("mkswap"); if (status != 0) throw String("mkswap failed"); @@ -160,7 +160,7 @@ args.clear(); args.push_back(path); if (utils::execute("/sbin/swapon", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("swapon"); if (status != 0) throw String("swapon failed"); } --- conga/ricci/modules/storage/System.cpp 2006/08/10 22:53:09 1.3 +++ conga/ricci/modules/storage/System.cpp 2006/10/06 03:10:13 1.4 @@ -56,7 +56,7 @@ String out, err; int status; if (utils::execute("/sbin/blockdev", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("blockdev"); if (status) throw String("blockdev failed"); --- conga/ricci/modules/storage/VG.cpp 2006/09/26 01:16:13 1.6 +++ conga/ricci/modules/storage/VG.cpp 2006/10/06 03:10:13 1.7 @@ -54,7 +54,7 @@ String out, err; int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(LVM_BIN_PATH); if (status) throw String("vgs failed"); vector lines = utils::split(out, "\n"); --- conga/ricci/modules/storage/mdadm_wrapper.cpp 2006/08/10 22:53:09 1.4 +++ conga/ricci/modules/storage/mdadm_wrapper.cpp 2006/10/06 03:10:13 1.5 @@ -104,7 +104,7 @@ String out, err; int status; if (utils::execute(MDADM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MDADM_BIN_PATH); if (status) throw String("mdadm failed"); utils::clear_cache(); @@ -121,7 +121,7 @@ args.push_back("--zero-superblock"); args.push_back(path); if (utils::execute(MDADM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MDADM_BIN_PATH); if (status) throw String("mdadm failed"); utils::clear_cache(); @@ -138,7 +138,7 @@ String out, err; int status; if (utils::execute(MDADM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MDADM_BIN_PATH); if (status) throw String("mdadm failed"); utils::clear_cache(); @@ -155,7 +155,7 @@ String out, err; int status; if (utils::execute(MDADM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MDADM_BIN_PATH); if (status) throw String("mdadm failed"); utils::clear_cache(); @@ -174,7 +174,7 @@ String out, err; int status; if (utils::execute(MDADM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MDADM_BIN_PATH); if (status) throw String("mdadm failed"); utils::clear_cache(); @@ -189,7 +189,7 @@ String out, err; int status; if (utils::execute(MDADM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MDADM_BIN_PATH); if (status) throw String("mdadm failed"); utils::clear_cache(); @@ -247,7 +247,7 @@ String out, err; int status; if (utils::execute(MDADM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MDADM_BIN_PATH); if (status) throw String("mdadm failed"); utils::clear_cache(); @@ -271,7 +271,7 @@ String out, err; int status; if (utils::execute(MDADM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MDADM_BIN_PATH); if (status) throw String("mdadm failed"); @@ -369,7 +369,7 @@ String out, err; int status; if (utils::execute(MDADM_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(MDADM_BIN_PATH); if (status) throw String("mdadm failed"); --- conga/ricci/modules/storage/parted_wrapper.cpp 2006/08/24 14:51:44 1.7 +++ conga/ricci/modules/storage/parted_wrapper.cpp 2006/10/06 03:10:13 1.8 @@ -247,7 +247,7 @@ String out, err; int status; if (utils::execute(PARTED_BIN_PATH, args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg(PARTED_BIN_PATH); if (status) throw String("parted failed") + " " + pt_path; return out; @@ -479,7 +479,7 @@ String out, err; int status; if (utils::execute("/sbin/blockdev", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("blockdev"); if (status) throw String("blockdev failed"); vector lines = utils::split(out, "\n"); @@ -534,7 +534,7 @@ String out, err; int status; if (utils::execute(PARTED_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(PARTED_BIN_PATH); if (status) throw String("parted failed"); } @@ -569,7 +569,7 @@ args.push_back("seek=447"); args.push_back("count=64"); if (utils::execute("/bin/dd", args, out, err, status)) - throw String("execute failed"); + throw command_not_found_error_msg("dd"); if (status != 0) throw String("dd failed"); utils::clear_cache(); @@ -607,7 +607,7 @@ String out, err; int status; if (utils::execute(PARTED_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(PARTED_BIN_PATH); if (status) throw String("parted failed"); @@ -650,7 +650,7 @@ String out, err; int status; if (utils::execute(PARTED_BIN_PATH, args, out, err, status, false)) - throw String("execute failed"); + throw command_not_found_error_msg(PARTED_BIN_PATH); if (status) throw String("parted failed"); --- conga/ricci/ricci/Ricci.cpp 2006/08/24 20:15:29 1.17 +++ conga/ricci/ricci/Ricci.cpp 2006/10/06 03:10:13 1.18 @@ -441,7 +441,7 @@ err, status, false)) - throw String("execution of ricci-worker failed"); + throw command_not_found_error_msg(RICCI_WORKER_PATH); if (status) throw String("execution of ricci-worker failed"); } @@ -548,7 +548,7 @@ err, status, false)) - throw String("execution of virsh failed"); + throw command_not_found_error_msg("/usr/bin/virsh"); if (status == 0) return true; } catch ( ... ) {}