Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Cluster Development (http://www.linux-archive.org/cluster-development/)
-   -   resource-agents: Use literal quotes for tr calls (http://www.linux-archive.org/cluster-development/483618-resource-agents-use-literal-quotes-tr-calls.html)

Lon Hohberger 01-31-2011 10:01 PM

resource-agents: Use literal quotes for tr calls
 
This affects SAPInstance / SAPDatabase agents.

Resolves: rhbz#639252

Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
rgmanager/src/resources/SAPDatabase | 16 ++++++++--------
rgmanager/src/resources/SAPInstance | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/rgmanager/src/resources/SAPDatabase b/rgmanager/src/resources/SAPDatabase
index 8ac3005..5027018 100644
--- a/rgmanager/src/resources/SAPDatabase
+++ b/rgmanager/src/resources/SAPDatabase
@@ -201,7 +201,7 @@ do_exit() {
# listener_start: Start the given listener
#
listener_start() {
- orasid="ora`echo $SID | tr [:upper:] [:lower:]`"
+ orasid="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
rc=$OCF_SUCCESS
output=`echo "lsnrctl start $NETSERVICENAME" | su - $orasid 2>&1`
if [ $? -eq 0 ]
@@ -219,7 +219,7 @@ listener_start() {
# listener_stop: Stop the given listener
#
listener_stop() {
- orasid="ora`echo $SID | tr [:upper:] [:lower:]`"
+ orasid="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
rc=$OCF_SUCCESS
if
listener_status
@@ -243,7 +243,7 @@ listener_stop() {
# listener_status: is the given listener running?
#
listener_status() {
- orasid="ora`echo $SID | tr [:upper:] [:lower:]`"
+ orasid="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
# Note: ps cuts off it's output at column $COLUMNS, so "ps -ef" can not be used here
# as the output might be to long.
cnt=`ps efo args --user $orasid | grep $NETSERVICENAME | grep -c tnslsnr`
@@ -502,7 +502,7 @@ exit $rc" > $TEMPFILE
# db6udb_recover: try to recover DB/2 after a crash
#
db6udb_recover() {
- db2sid="db2`echo $SID | tr [:upper:] [:lower:]`"
+ db2sid="db2`echo $SID | tr '[:upper:]' '[:lower:]'`"

echo '#!/bin/sh
LOG=$HOME/recover.log
@@ -752,11 +752,11 @@ sapdatabase_status() {
SNUM=2
;;
ORA) SEARCH="ora_[a-z][a-z][a-z][a-z]_"
- SUSER="ora`echo $SID | tr [:upper:] [:lower:]`"
+ SUSER="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
SNUM=4
;;
DB6) SEARCH="db2[a-z][a-z][a-z][a-z][a-z]"
- SUSER="db2`echo $SID | tr [:upper:] [:lower:]`"
+ SUSER="db2`echo $SID | tr '[:upper:]' '[:lower:]'`"
SNUM=5
;;
esac
@@ -876,7 +876,7 @@ if [ -z "$OCF_RESKEY_DBTYPE" ]; then
ocf_log err "Please set OCF_RESKEY_DBTYPE to the database vendor specific tag (ORA,ADA,DB6)!"
do_exit $OCF_ERR_ARGS
fi
-DBTYPE=`echo "$OCF_RESKEY_DBTYPE" | tr "[a-z]" "[A-Z]"`
+DBTYPE=`echo "$OCF_RESKEY_DBTYPE" | tr '[a-z]' '[A-Z]'`

# optional OCF parameters, we try to guess which directories are correct
EXESTARTDB="startdb"
@@ -995,7 +995,7 @@ fi
if [ `echo $LD_LIBRARY_PATH | grep -c "^$DIR_EXECUTABLE>"` -eq 0 ]; then
LD_LIBRARY_PATH=$DIR_EXECUTABLE:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
fi
-sidadm="`echo $SID | tr [:upper:] [:lower:]`adm"
+sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"

# What kind of method was invoked?
case "$1" in
diff --git a/rgmanager/src/resources/SAPInstance b/rgmanager/src/resources/SAPInstance
index 94643c9..e70e2a3 100644
--- a/rgmanager/src/resources/SAPInstance
+++ b/rgmanager/src/resources/SAPInstance
@@ -568,7 +568,7 @@ fi
if [ `echo $LD_LIBRARY_PATH | grep -c "^$DIR_EXECUTABLE>"` -eq 0 ]; then
LD_LIBRARY_PATH=$DIR_EXECUTABLE:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
fi
-sidadm="`echo $SID | tr [:upper:] [:lower:]`adm"
+sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"

# What kind of method was invoked?
case "$1" in
--
1.7.2.3


All times are GMT. The time now is 06:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.