From dcad558752b0ba07a28f31099695ed57ae8f2bde Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Fri, 8 Jun 2012 17:44:16 -0700 Subject: [PATCH] Issue 966: removed pid bracketing --- compute/src/test/resources/initscript_with_java.sh | 4 ++-- compute/src/test/resources/initscript_with_jboss.sh | 4 ++-- compute/src/test/resources/runscript.sh | 4 ++-- compute/src/test/resources/runscript_adminUpdate.sh | 4 ++-- compute/src/test/resources/runscript_jboss.sh | 4 ++-- .../src/test/resources/test_guest_additions_installer_init.sh | 4 ++-- .../src/main/java/org/jclouds/scriptbuilder/InitBuilder.java | 2 +- .../src/main/java/org/jclouds/scriptbuilder/InitScript.java | 2 +- scriptbuilder/src/main/resources/functions/forget.sh | 2 +- scriptbuilder/src/test/resources/test_ebs.sh | 4 ++-- scriptbuilder/src/test/resources/test_init.sh | 4 ++-- scriptbuilder/src/test/resources/test_init_script.sh | 4 ++-- .../src/test/resources/test_install_jdk_scriptbuilder.sh | 4 ++-- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/compute/src/test/resources/initscript_with_java.sh b/compute/src/test/resources/initscript_with_java.sh index 093c4c2c2f..5a0dd5bb12 100644 --- a/compute/src/test/resources/initscript_with_java.sh +++ b/compute/src/test/resources/initscript_with_java.sh @@ -43,7 +43,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -213,7 +213,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1 diff --git a/compute/src/test/resources/initscript_with_jboss.sh b/compute/src/test/resources/initscript_with_jboss.sh index f9bd79504b..4f38530e99 100644 --- a/compute/src/test/resources/initscript_with_jboss.sh +++ b/compute/src/test/resources/initscript_with_jboss.sh @@ -43,7 +43,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -222,7 +222,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1 diff --git a/compute/src/test/resources/runscript.sh b/compute/src/test/resources/runscript.sh index 44d5880cde..b53c201cda 100644 --- a/compute/src/test/resources/runscript.sh +++ b/compute/src/test/resources/runscript.sh @@ -43,7 +43,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -193,7 +193,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1 diff --git a/compute/src/test/resources/runscript_adminUpdate.sh b/compute/src/test/resources/runscript_adminUpdate.sh index e2f9a5397b..5e0c289d55 100644 --- a/compute/src/test/resources/runscript_adminUpdate.sh +++ b/compute/src/test/resources/runscript_adminUpdate.sh @@ -43,7 +43,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -118,7 +118,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1 diff --git a/compute/src/test/resources/runscript_jboss.sh b/compute/src/test/resources/runscript_jboss.sh index a919188c91..172cb9eab7 100644 --- a/compute/src/test/resources/runscript_jboss.sh +++ b/compute/src/test/resources/runscript_jboss.sh @@ -44,7 +44,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -206,7 +206,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1 diff --git a/labs/virtualbox/src/test/resources/test_guest_additions_installer_init.sh b/labs/virtualbox/src/test/resources/test_guest_additions_installer_init.sh index 53bae7b1cd..751e9c00c5 100644 --- a/labs/virtualbox/src/test/resources/test_guest_additions_installer_init.sh +++ b/labs/virtualbox/src/test/resources/test_guest_additions_installer_init.sh @@ -43,7 +43,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -176,7 +176,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1 diff --git a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/InitBuilder.java b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/InitBuilder.java index 45f4f72b87..3b0f3e76be 100644 --- a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/InitBuilder.java +++ b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/InitBuilder.java @@ -94,7 +94,7 @@ public class InitBuilder extends ScriptBuilder { createRunScript)) .put("status", newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), - interpret("echo [{varl}FOUND_PID{varr}]{lf}"))) + interpret("echo {varl}FOUND_PID{varr}{lf}"))) .put("stop", newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), kill())) .put("start", diff --git a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/InitScript.java b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/InitScript.java index 439c96f1b6..651cc60733 100644 --- a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/InitScript.java +++ b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/InitScript.java @@ -209,7 +209,7 @@ public class InitScript extends ForwardingObject implements Statement, AcceptsSt .put("init", newStatementList(call("default"), call(instanceName), init, createRunScript)) .put("status", newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), - interpret("echo [{varl}FOUND_PID{varr}]{lf}"))) + interpret("echo {varl}FOUND_PID{varr}{lf}"))) .put("stop", newStatementList(call("default"), findPid("{varl}INSTANCE_NAME{varr}"), kill())) .put("start", diff --git a/scriptbuilder/src/main/resources/functions/forget.sh b/scriptbuilder/src/main/resources/functions/forget.sh index b4a9a2ef4e..994000eb48 100644 --- a/scriptbuilder/src/main/resources/functions/forget.sh +++ b/scriptbuilder/src/main/resources/functions/forget.sh @@ -10,7 +10,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & diff --git a/scriptbuilder/src/test/resources/test_ebs.sh b/scriptbuilder/src/test/resources/test_ebs.sh index be055d73c6..58d1ebca62 100644 --- a/scriptbuilder/src/test/resources/test_ebs.sh +++ b/scriptbuilder/src/test/resources/test_ebs.sh @@ -46,7 +46,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -120,7 +120,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1 diff --git a/scriptbuilder/src/test/resources/test_init.sh b/scriptbuilder/src/test/resources/test_init.sh index f2bf3e98f2..81f3c356ec 100644 --- a/scriptbuilder/src/test/resources/test_init.sh +++ b/scriptbuilder/src/test/resources/test_init.sh @@ -44,7 +44,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -103,7 +103,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1 diff --git a/scriptbuilder/src/test/resources/test_init_script.sh b/scriptbuilder/src/test/resources/test_init_script.sh index a47ed3ec79..be2cecc0c5 100644 --- a/scriptbuilder/src/test/resources/test_init_script.sh +++ b/scriptbuilder/src/test/resources/test_init_script.sh @@ -43,7 +43,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -121,7 +121,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1 diff --git a/scriptbuilder/src/test/resources/test_install_jdk_scriptbuilder.sh b/scriptbuilder/src/test/resources/test_install_jdk_scriptbuilder.sh index 334cc4c868..5a3efe0d08 100644 --- a/scriptbuilder/src/test/resources/test_install_jdk_scriptbuilder.sh +++ b/scriptbuilder/src/test/resources/test_install_jdk_scriptbuilder.sh @@ -43,7 +43,7 @@ function forget { mkdir -p $LOG_DIR findPid $INSTANCE_NAME [ -n "$FOUND_PID" -a -f $LOG_DIR/stdout.log ] && { - echo $INSTANCE_NAME already running pid [$FOUND_PID] + echo $INSTANCE_NAME already running pid $FOUND_PID return 1; } || { nohup $SCRIPT >$LOG_DIR/stdout.log 2>$LOG_DIR/stderr.log & @@ -193,7 +193,7 @@ END_OF_JCLOUDS_SCRIPT status) default || exit 1 findPid $INSTANCE_NAME || exit 1 - echo [$FOUND_PID] + echo $FOUND_PID ;; stop) default || exit 1