Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hadoop: support openjdk-6 (default in UEC11.10)

oneiric 11.10 images use openjdk-6 instead of the sun-6 package. updated
the hadoop plugin to search for both openjdk/sun java 6 packages when
setting JAVA_HOME hadoop environment.
  • Loading branch information...
commit 13fbcb310fb2d13ef4ab043ab9bac53f2644672a 1 parent 3e56337
@jtriley authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 starcluster/plugins/hadoop.py
View
9 starcluster/plugins/hadoop.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
import posixpath
from starcluster import threadpool
@@ -87,7 +86,8 @@ def __init__(self, hadoop_tmpdir='/mnt/hadoop'):
self.empty_conf = '/etc/hadoop-0.20/conf.empty'
self.centos_java_home = '/usr/lib/jvm/java'
self.centos_alt_cmd = 'alternatives'
- self.ubuntu_java_home = '/usr/lib/jvm/java-6-sun/jre'
+ self.ubuntu_javas = ['/usr/lib/jvm/java-6-sun/jre',
+ '/usr/lib/jvm/java-6-openjdk/jre']
self.ubuntu_alt_cmd = 'update-alternatives'
self._pool = None
@@ -101,7 +101,10 @@ def _get_java_home(self, node):
# check for CentOS, otherwise default to Ubuntu 10.04's JAVA_HOME
if node.ssh.isfile('/etc/redhat-release'):
return self.centos_java_home
- return self.ubuntu_java_home
+ for java in self.ubuntu_javas:
+ if node.ssh.isdir(java):
+ return java
+ raise Exception("Cant find JAVA jre")
def _get_alternatives_cmd(self, node):
# check for CentOS, otherwise default to Ubuntu 10.04
Please sign in to comment.
Something went wrong with that request. Please try again.