From 968c6ba70cbcc058823947cc925072e03cbb0ac8 Mon Sep 17 00:00:00 2001 From: M S Vishwanath Bhat Date: Fri, 16 Mar 2012 17:02:46 +0530 Subject: Using correct path to build and find jar file in build_deploy_jar. Change-Id: Ifeadd60370b36ab7b345c336a40a17091698ffe5 BUG: 803879 Signed-off-by: M S Vishwanath Bhat Reviewed-on: http://review.gluster.com/2955 Tested-by: Gluster Build System Reviewed-by: Venky Shankar --- glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py | 25 ++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) mode change 100644 => 100755 glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py diff --git a/glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py b/glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py old mode 100644 new mode 100755 index 450e08fb0..3c67108e1 --- a/glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py +++ b/glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py @@ -44,7 +44,6 @@ def whereis(program): return None def getLatestJar(targetdir): - latestJar = None glusterfsJar = glob.glob(targetdir + "*.jar") if len(glusterfsJar) == 0: print "No GlusterFS jar file found in %s ... exiting" % (targetdir) @@ -63,7 +62,7 @@ def getLatestJar(targetdir): return latestJar # build the glusterfs hadoop plugin using maven -def build_jar(): +def build_jar(targetdir): location = whereis('mvn') if location == None: @@ -72,7 +71,6 @@ def build_jar(): return None # do a clean packaging - targetdir = "./target/" if os.path.exists(targetdir) and os.path.isdir(targetdir): print "Cleaning up directories ... [ " + targetdir + " ]" shutil.rmtree(targetdir) @@ -81,13 +79,10 @@ def build_jar(): process = subprocess.Popen(['package'], shell=True, executable=location, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - try: - (pout, perr) = process.communicate() - except: - process.wait() - if not process.returncode == 0: - print "Building glusterfs jar failed" - return None + process.wait() + if not process.returncode == 0: + print "Building glusterfs jar failed ... exiting" + return None latestJar = getLatestJar(targetdir) return latestJar @@ -140,7 +135,6 @@ def deployInMaster(f, confdir, libdir): socket.inet_aton(host) h = socket.getfqdn(host) except socket.error: - # host is not a ip adddress pass if h == socket.gethostname() or h == 'localhost': @@ -182,14 +176,17 @@ if __name__ == '__main__': assert not hadoop_dir == None, "hadoop directory missing" + os.chdir(os.path.dirname(sys.argv[0]) + '/..') + targetdir = './target/' + if needbuild: - jar = build_jar() + jar = build_jar(targetdir) if jar == None: sys.exit(1) else: - jar = getLatestJar('./target/') + jar = getLatestJar(targetdir) if jar == None: - print "Maybe you want to build it ? -b option" + print "Maybe you want to build it ? with -b option" sys.exit(1) print "" -- cgit