All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] resource-agents: nfsclient: fix wildcard status checks [RHEL5]
@ 2011-10-28  2:26 Lon Hohberger
  2011-10-28  4:46 ` Fabio M. Di Nitto
  0 siblings, 1 reply; 2+ messages in thread
From: Lon Hohberger @ 2011-10-28  2:26 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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
-- 
1.7.3.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [PATCH] resource-agents: nfsclient: fix wildcard status checks [RHEL5]
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Fabio M. Di Nitto @ 2011-10-28  4:46 UTC (permalink / raw)
  To: cluster-devel.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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-28  4:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.