Skip to contentSkip to conversation

conga/ricci include/utils.h modules/cluster/Cl ...

Cluster-devel [email protected] 1 participant 1 message Oct 6, 2006

lore
Share & tools
lore
#0 lore raw

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

ricci/include/utils.h +6 -0
@@ -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
ricci/modules/cluster/ClusterConf.cpp +2 -2
@@ -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");
       }
ricci/modules/cluster/ClusterStatus.cpp +2 -2
@@ -352,7 +352,7 @@
   int status;
   vector<String> 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");
   }
ricci/modules/cluster/Clusvcadm.cpp +5 -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");
   
ricci/modules/cluster/Fence.cpp +1 -1
@@ -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");
 }
ricci/modules/rpm/PackageHandler.cpp +10 -10
@@ -73,7 +73,7 @@
       vector<String> 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<String> 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<String> lines = utils::split(utils::strip(out), "\n");
     for (vector<String>::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<String> lines = utils::split(utils::strip(out), "\n");
     for (vector<String>::const_iterator iter = lines.begin();
 	 iter != lines.end();
@@ -165,7 +165,7 @@
     for (vector<String>::size_type i=0; i<rpms.size(); i++)
       args.push_back(rpms[i]);
     if (utils::execute(UP2DATE_PATH, args, out, err, status, true))
-      throw String("execute failed");
+      throw command_not_found_error_msg(UP2DATE_PATH);
     if (status != 0)
       throw String(UP2DATE_PATH) + " failed";
     return true;
@@ -180,7 +180,7 @@
     args.push_back("list");
     args.push_back("installed");
     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;
     vector<String> 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<String> 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<String> lines = utils::split(out, "\n");
@@ -421,7 +421,7 @@
     vector<String> 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<String> 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) {
ricci/modules/service/ServiceManager.cpp +4 -4
@@ -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<String> 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<String> 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<String> lines = utils::split(out, "\n");
ricci/modules/storage/BD.cpp +1 -1
@@ -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);
ricci/modules/storage/ContentFS.cpp +1 -1
@@ -281,6 +281,6 @@
   vector<String> 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;
 }
ricci/modules/storage/ContentNone.cpp +1 -1
@@ -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);
 }
ricci/modules/storage/ExtendedFS.cpp +7 -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<String> 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";
   
ricci/modules/storage/GFS1.cpp +1 -1
@@ -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";
   
ricci/modules/storage/GFS2.cpp +1 -1
@@ -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";
   
ricci/modules/storage/HD.cpp +5 -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<String> 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<String> words = utils::split(out);
ricci/modules/storage/LVM.cpp +22 -22

176 lines not on this page · raw message

ricci/modules/storage/MountHandler.cpp +4 -4
@@ -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";
 }
ricci/modules/storage/SwapFS.cpp +2 -2
@@ -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");
   }
ricci/modules/storage/System.cpp +1 -1
@@ -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");
   
ricci/modules/storage/VG.cpp +1 -1
@@ -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<String> lines = utils::split(out, "\n");
ricci/modules/storage/mdadm_wrapper.cpp +9 -9
@@ -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");
   
ricci/modules/storage/parted_wrapper.cpp +6 -6
@@ -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<String> 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");
   
ricci/ricci/Ricci.cpp +2 -2
@@ -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 ( ... ) {}