From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24224 invoked by alias); 17 Jul 2008 04:43:16 -0000 Received: (qmail 24189 invoked by uid 9702); 17 Jul 2008 04:43:14 -0000 Date: Thu, 17 Jul 2008 04:43:00 -0000 Message-ID: <20080717044314.24174.qmail@sourceware.org> From: fabbione@sourceware.org To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com Subject: Cluster Project branch, master, updated. cluster-2.99.06-16-g31d7346 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 986180d297a20592039dd8818d1d7ffa39d79d62 X-Git-Newrev: 31d7346b1f901ad5c7351261cff0699918fbd782 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q3/txt/msg00083.txt.bz2 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project". http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=31d7346b1f901ad5c7351261cff0699918fbd782 The branch, master has been updated via 31d7346b1f901ad5c7351261cff0699918fbd782 (commit) from 986180d297a20592039dd8818d1d7ffa39d79d62 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 31d7346b1f901ad5c7351261cff0699918fbd782 Author: Fabio M. Di Nitto Date: Thu Jul 17 06:42:24 2008 +0200 [RGMANAGER] Port smb resource agent to ccs_tool Fix also a wrong arg in get_service_ip_keys in config-utils.sh.in Signed-off-by: Fabio M. Di Nitto ----------------------------------------------------------------------- Summary of changes: rgmanager/src/resources/smb.sh | 99 ++++------------------ rgmanager/src/resources/utils/config-utils.sh.in | 2 +- 2 files changed, 17 insertions(+), 84 deletions(-) diff --git a/rgmanager/src/resources/smb.sh b/rgmanager/src/resources/smb.sh index 73087c1..9fad178 100644 --- a/rgmanager/src/resources/smb.sh +++ b/rgmanager/src/resources/smb.sh @@ -101,62 +101,18 @@ EOT # -# Usage: ccs_connect -# Returns: $_FAIL on failure, or a connection descriptor on success -# -ccs_connect() -{ - declare outp - - outp=$(ccs_test connect 2>&1) - if [ $? -ne 0 ]; then - ocf_log err "$outp" - return $_FAIL - fi - - outp=${outp/*= /} - if [ -n "$outp" ]; then - echo $outp - return 0 - fi - - return 1 -} - - -# -# Usage: ccs_disconnect desc -# -ccs_disconnect() -{ - declare outp - - [ -n "$1" ] || return $_FAIL - outp=$(ccs_test disconnect $1 2>&1) - if [ $? -ne 0 ]; then - ocf_log warn "Disconnect CCS desc $1 failed: $outp" - return 1 - fi - return 0 -} - - -# -# Usage: ccs_get desc key +# Usage: ccs_get key # ccs_get() { declare outp - declare ccsfd=$1 declare key [ -n "$1" ] || return $_FAIL - [ -n "$2" ] || return $_FAIL - shift key="$*" - outp=$(ccs_test get $ccsfd "$key" 2>&1) + outp=$(ccs_tool query -c "$key" 2>&1) if [ $? -ne 0 ]; then if [ "$outp" = "${outp/No data available/}" ]; then ocf_log err "$outp ($key)" @@ -181,17 +137,11 @@ ccs_get() # get_service_ip_keys() { - declare -i ccsfd=$1 - declare svc=$2 + declare svc=$1 declare -i x y=0 declare outp declare key - if [ $ccsfd -eq $_FAIL ]; then - ocf_log err "Can not talk to ccsd: invalid descriptor $ccsfd" - return 1 - fi - # # Find service-local IP keys # @@ -202,7 +152,7 @@ get_service_ip_keys() # # Try direct method # - outp=$(ccs_get $ccsfd "$key/@address") + outp=$(ccs_get "$key/@address") if [ $? -ne 0 ]; then return 1 fi @@ -211,7 +161,7 @@ get_service_ip_keys() # Try by reference # if [ -z "$outp" ]; then - outp=$(ccs_get $ccsfd "$key/@ref") + outp=$(ccs_get "$key/@ref") if [ $? -ne 0 ]; then return 1 fi @@ -241,17 +191,11 @@ get_service_ip_keys() # get_service_fs_keys() { - declare -i ccsfd=$1 - declare svc=$2 + declare svc=$1 declare -i x y=0 declare outp declare key - if [ $ccsfd -eq $_FAIL ]; then - ocf_log err "Can not talk to ccsd: invalid descriptor $ccsfd" - return 1 - fi - # # Find service-local IP keys # @@ -262,7 +206,7 @@ get_service_fs_keys() # # Try direct method # - outp=$(ccs_get $ccsfd "$key/@name") + outp=$(ccs_get "$key/@name") if [ $? -ne 0 ]; then return 1 fi @@ -271,7 +215,7 @@ get_service_fs_keys() # Try by reference # if [ -z "$outp" ]; then - outp=$(ccs_get $ccsfd "$key/@ref") + outp=$(ccs_get "$key/@ref") if [ $? -ne 0 ]; then return 1 fi @@ -298,12 +242,11 @@ get_service_fs_keys() build_ip_list() { - declare -i ccsfd=$1 declare ipaddrs ipaddr declare -i x=0 while [ -n "${ipkeys[$x]}" ]; do - ipaddr=$(ccs_get $ccsfd "${ipkeys[$x]}/@address") + ipaddr=$(ccs_get "${ipkeys[$x]}/@address") if [ -z "$ipaddr" ]; then break fi @@ -359,8 +302,7 @@ verify_sha1() add_fs_entries() { - declare -i ccsfd=$1 - declare conf="$2" + declare conf="$1" declare sharename declare sharepath key @@ -369,13 +311,13 @@ add_fs_entries() while [ -n "${fskeys[$x]}" ]; do key="${fskeys[$x]}/@name" - sharename=$(ccs_get $ccsfd "$key") + sharename=$(ccs_get "$key") if [ -z "$sharename" ]; then break fi key="${fskeys[$x]}/@mountpoint" - sharepath=$(ccs_get $ccsfd "$key") + sharepath=$(ccs_get "$key") if [ -z "$sharepath" ]; then break fi @@ -402,7 +344,6 @@ EODEV # gen_smb_conf() { - declare -i ccsfd=$_FAIL declare conf="$1" declare lvl="debug" @@ -418,15 +359,8 @@ gen_smb_conf() ocf_log $lvl "Creating $conf" - ccsfd=$(ccs_connect) - if [ $? -eq $_FAIL ]; then - return $OCF_ERR_GENERIC - fi - - ocf_log debug "Acquired CCS descriptor $ccsfd" - - get_service_ip_keys $ccsfd "$OCF_RESKEY_service_name" - get_service_fs_keys $ccsfd "$OCF_RESKEY_service_name" + get_service_ip_keys "$OCF_RESKEY_service_name" + get_service_fs_keys "$OCF_RESKEY_service_name" cat > "$conf" <