All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio M. Di Nitto <fdinitto@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] resource-agents: nfsclient: fix wildcard status checks [RHEL5]
Date: Fri, 28 Oct 2011 06:46:02 +0200	[thread overview]
Message-ID: <4EAA338A.7070408@redhat.com> (raw)
In-Reply-To: <1319768780-2769-1-git-send-email-lhh@redhat.com>

ACK

Fabio

On 10/28/2011 04:26 AM, Lon Hohberger wrote:
> Several permutations of nfsclients with options were
> not checked correctly due to bad pattern matching.
> 
> Resolves: rhbz#700103
> 
> Signed-off-by: Lon Hohberger <lhh@redhat.com>
> ---
>  rgmanager/src/resources/nfsclient.sh |   20 ++++++++++++--------
>  1 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/rgmanager/src/resources/nfsclient.sh b/rgmanager/src/resources/nfsclient.sh
> index 138370d..42ed2ce 100755
> --- a/rgmanager/src/resources/nfsclient.sh
> +++ b/rgmanager/src/resources/nfsclient.sh
> @@ -391,8 +391,8 @@ status|monitor)
>  		exportfs -v > $tmpfn
>  	fi
>  
> -        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -iq \
> -		"^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_regexp}" 
> +        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -Piq \
> +		"^${OCF_RESKEY_path}[\t ]+${OCF_RESKEY_target_regexp}" 
>  	rv=$? 
>  
>  	if [ $rv -eq 0 ]; then
> @@ -400,15 +400,19 @@ status|monitor)
>  		exit 0
>  	fi
>  
> -	declare OCF_RESKEY_target_tmp=$(clufindhostname -i "$OCF_RESKEY_target")
> +	declare OCF_RESKEY_target_tmp
> +	OCF_RESKEY_target_tmp=$(clufindhostname -i "$OCF_RESKEY_target")
>  	if [ $? -ne 0 ]; then
> -		[ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
> -		ocf_log err "nfsclient:$OCF_RESKEY_name is missing!"
> -		exit 1
> +		OCF_RESKEY_target_tmp=$(clufindhostname -n "$OCF_RESKEY_target")
> +		if [ $? -ne 0 ]; then
> +			[ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
> +			ocf_log err "nfsclient:$OCF_RESKEY_name is missing!"
> +			exit 1
> +		fi
>  	fi
>  
> -        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \
> -		"^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_tmp}" 
> +        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -Pq \
> +		"^${OCF_RESKEY_path}[\t ]+${OCF_RESKEY_target_tmp}" 
>  	rv=$? 
>  
>  	[ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn



      reply	other threads:[~2011-10-28  4:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28  2:26 [Cluster-devel] [PATCH] resource-agents: nfsclient: fix wildcard status checks [RHEL5] Lon Hohberger
2011-10-28  4:46 ` Fabio M. Di Nitto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EAA338A.7070408@redhat.com \
    --to=fdinitto@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.