Index: /tags/ipp-pv3-20140717/ippTools/src/remotetool.c
===================================================================
--- /tags/ipp-pv3-20140717/ippTools/src/remotetool.c	(revision 37271)
+++ /tags/ipp-pv3-20140717/ippTools/src/remotetool.c	(revision 37272)
@@ -92,5 +92,5 @@
   PXOPT_LOOKUP_BOOL(simple,    config->args, "-simple",       false);
   PXOPT_LOOKUP_BOOL(pretend,   config->args, "-pretend",      false);
-  
+
   set_label = set_label ? set_label : label;
 
@@ -105,5 +105,5 @@
       return(false);
     }
-    
+
     if (label) {
       psStringAppend(&whereOption, "\n AND (label = '%s')", label);
@@ -116,9 +116,9 @@
       return(false);
     }
-    
+
     if (label) {
       psStringAppend(&whereOption, "\n AND (label = '%s')", label);
     }
-  }    
+  }
   else if (!strcmp(stage,"warp")) {
     query = pxDataGet("remotetool_definebyquery_warp.sql");
@@ -127,5 +127,5 @@
       return(false);
     }
-    
+
     if (label) {
       // Because warp has to check to see if something other than the state is set correctly, I have to use this wonky way to pass the label in.
@@ -133,5 +133,5 @@
       psStringAppend(&whereOption, "\n AND (label = '%s')", label);
     }
-  }    
+  }
   else if (!strcmp(stage,"stack")) {
     query = pxDataGet("remotetool_definebyquery_stack.sql");
@@ -140,9 +140,9 @@
       return(false);
     }
-    
+
     if (label) {
       psStringAppend(&whereOption, "\n AND (label = '%s')", label);
     }
-  }    
+  }
   else {
     psError(PS_ERR_UNKNOWN, true, "unknown value for stage: %s", stage);
@@ -191,17 +191,17 @@
   // Insert the top level run object
   remoteRunRow *run = remoteRunRowAlloc(0, // remote_id
-					"new", // state
-					stage,
-					set_label,
-					path_base,
-					-1, // job_id
-					NULL, // last_poll
-					0   // fault
-					  );
+                                        "new", // state
+                                        stage,
+                                        set_label,
+                                        path_base,
+                                        -1, // job_id
+                                        NULL, // last_poll
+                                        0   // fault
+                                          );
   if (!run) {
     psError(PS_ERR_UNKNOWN, false, "failed to alloc lapRun object");
     return(true);
   }
-  
+
   if (!remoteRunInsertObject(config->dbh, run)) {
     if (!psDBRollback(config->dbh)) {
@@ -213,5 +213,5 @@
   }
   psS64 remote_id = psDBLastInsertID(config->dbh);
-  
+
   psArray *list = psArrayAllocEmpty(limit);
   for (long i=0; i < psArrayLength(output); i++) {
@@ -220,13 +220,13 @@
 
     remoteComponentRow *comp = remoteComponentRowAlloc(remote_id,
-						       stage_id);
+                                                       stage_id);
     if (!comp) {
       psError(PS_ERR_UNKNOWN, false, "failed to alloc lapRun object");
       return(true);
     }
-    
+
     if (!remoteComponentInsertObject(config->dbh, comp)) {
       if (!psDBRollback(config->dbh)) {
-	psError(PS_ERR_UNKNOWN, false, "database error");
+        psError(PS_ERR_UNKNOWN, false, "database error");
       }
       psError(PS_ERR_UNKNOWN, false, "database error");
@@ -237,5 +237,5 @@
     psArrayAdd(list, list->n, comp);
     psFree(comp);
-    
+
   }
   psFree(run);
@@ -245,5 +245,5 @@
     return false;
   }
-  
+
   if (!remoteComponentPrintObjects(stdout, list, !simple)) {
     if (!psDBRollback(config->dbh)) {
@@ -254,8 +254,8 @@
     return false;
   }
-  
+
   psFree(list);
   psFree(output);
-					
+
   return true;
 }
@@ -265,5 +265,5 @@
 {
   psMetadata *where = psMetadataAlloc();
-  
+
   PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
   PXOPT_COPY_STR(config->args, where, "-state", "state", "==");
@@ -274,14 +274,14 @@
   PXOPT_COPY_TIME(config->args, where, "-poll_begin", "last_poll", ">=");
   PXOPT_COPY_TIME(config->args, where, "-poll_end", "last_poll", "<=");
-  
+
   PXOPT_COPY_S16(config->args, where, "-fault", "fault", "==");
 
   PXOPT_LOOKUP_S16(limit,   config->args, "-limit",  false, false);
   PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
-  
+
 
   psArray *remRuns = NULL;
   remRuns = psDBSelectRows(config->dbh, "remoteRun", where, limit);
-  
+
   if (!ippdbPrintMetadatas(stdout, remRuns, "remoteRun", !simple)) {
     psError(PS_ERR_UNKNOWN, false, "failed to print array");
@@ -300,8 +300,8 @@
   PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
   PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
-  
+
   psArray *remComps = NULL;
   remComps = psDBSelectRows(config->dbh, "remoteComponent", where, 0);
-  
+
   if (!ippdbPrintMetadatas(stdout, remComps, "remoteComponent", !simple)) {
     psError(PS_ERR_UNKNOWN, false, "failed to print array");
@@ -329,5 +329,5 @@
     return false;
   }
-  
+
   if (!psDBTransaction(config->dbh)) {
     psError(PS_ERR_UNKNOWN, false, "database error");
@@ -341,6 +341,6 @@
   }
   psFree(query);
-  
-  
+
+
 
   // point of no return
@@ -349,5 +349,5 @@
     return false;
   }
-  
+
   return true;
 }
@@ -364,5 +364,5 @@
   // Wheres
   PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
-  
+
   // Values to set
   PXOPT_COPY_STR(config->args, values, "-set_label", "label", "==");
@@ -375,8 +375,6 @@
 
   if (rows < 1) {
-    psError(PS_ERR_UNKNOWN,false, "no rows affected");
-    return(false);
-  }
-  
+      fprintf (stderr, "no rows changed (run may already be in desired state)\n");
+  }
   return(true);
 }
@@ -393,5 +391,5 @@
   psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
   psFree(where);
-  
+
   psString query = NULL;
   query = pxDataGet("remotetool_updatepoll.sql");
@@ -412,7 +410,7 @@
   return(true);
 }
-  
-
-  
+
+
+
 
 static bool revertrunMode(pxConfig *config)
@@ -426,5 +424,5 @@
   PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
   PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
-  
+
   // Value to set
   PXOPT_COPY_S16(config->args, values, "-fault", "fault", "==");
@@ -451,9 +449,9 @@
   PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
 
-  psMetadataAddStr(where, PS_LIST_TAIL, "state", 0, "==", "auth"); 
+  psMetadataAddStr(where, PS_LIST_TAIL, "state", 0, "==", "auth");
 
   // Value to set
   psMetadataAddStr(values, PS_LIST_TAIL, "state", 0, "==", "run");
-  
+
   long rows = psDBUpdateRows(config->dbh, "remoteRun", where, values);
   psFree(values);
@@ -466,3 +464,3 @@
   return(true);
 }
-    
+
