summaryrefslogtreecommitdiffstats
path: root/glusterfs-hadoop/0.20.2
diff options
context:
space:
mode:
authorM S Vishwanath Bhat <vishwanath@gluster.com>2012-03-16 17:02:46 +0530
committerAnand Avati <avati@redhat.com>2012-03-18 01:41:12 -0700
commit968c6ba70cbcc058823947cc925072e03cbb0ac8 (patch)
treee796e217e5487b7f760acd401f790944f888b2cc /glusterfs-hadoop/0.20.2
parente6753927338a12175f3a87fd4349d41847b8d2aa (diff)
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 <vishwanath@gluster.com> Reviewed-on: http://review.gluster.com/2955 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'glusterfs-hadoop/0.20.2')
-rwxr-xr-x[-rw-r--r--]glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py b/glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py
index 450e08fb0c6..3c67108e199 100644..100755
--- 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 ""