cluster: RHEL6 - config: fix handling of temporary directory in ccs_update_schema

Fabio M. Di Nitto fabbione at fedoraproject.org
Mon Aug 29 09:19:54 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=89fc6dab71b106e7d9f81bd29802ec20ee01bd5f
Commit:        89fc6dab71b106e7d9f81bd29802ec20ee01bd5f
Parent:        9be180ab1ac0f7e84818ae17c7fddd1f168d22da
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Mon Aug 29 11:09:41 2011 +0200
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Mon Aug 29 11:16:07 2011 +0200

config: fix handling of temporary directory in ccs_update_schema

tempdir was not set/exported and deleted correctly, leaving clutter
in /tmp

Resolves: rhbz#680930

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 config/tools/xml/ccs_update_schema.in |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/config/tools/xml/ccs_update_schema.in b/config/tools/xml/ccs_update_schema.in
index e149896..03dbb68 100644
--- a/config/tools/xml/ccs_update_schema.in
+++ b/config/tools/xml/ccs_update_schema.in
@@ -56,9 +56,15 @@ if [ "$?" != 0 ]; then
 fi
 check_opts $opts
 
+tmpdir="$(mktemp -d -q)" || {
+	echo "unable to create tempdir" >&2
+	exit 1
+}
+export tmpdir
+
 # need to be careful (might have to mask traps on exit)
 cleanup() {
-	[ -n "$tmpdir" ] && [ -d "$tmddir" ] && rm -rf "$tmpdir"
+	[ -n "$tmpdir" ] && [ -d "$tmpdir" ] && rm -rf "$tmpdir"
 	rm -f $vardir/rng_update.lock
 	exit $1
 }
@@ -342,11 +348,6 @@ install_schema() {
 (
 	flock --exclusive 200
 
-	tmpdir="$(mktemp -d -q)" || {
-		echo "unable to create tempdir" >&2
-		exit 1
-	}
-
 	lecho "Generating resource-agents cache"
 
 	generate_ras "$tmpdir" || {


More information about the cluster-commits mailing list