update swift_hadoop element
This change replaces the hardcoded value for the hadoop swift jar filename with a variable that defaults to the old value "hadoop-swift.jar" but also allows redefinition. * add variables for hadoop swift jar file name * add documentation for new variable * correct documentation for the lib path variable * add more to the basic description documentation Change-Id: I44eaaa8b23ae30231b7b4087740d8dd5d050ec00 Closes-Bug: 1498967
This commit is contained in:
parent
3aab9bde36
commit
c00560e4db
|
@ -2,7 +2,9 @@
|
|||
swift_hadoop
|
||||
============
|
||||
|
||||
Install a Swift jar file into the image.
|
||||
Install the Hadoop swift connector jar file into the image. By default, this
|
||||
jar file is generated from the sources available in the sahara-extras
|
||||
repository.
|
||||
|
||||
Environment Variables
|
||||
---------------------
|
||||
|
@ -10,9 +12,14 @@ Environment Variables
|
|||
swift_url
|
||||
:Required: No
|
||||
:Default: http://sahara-files.mirantis.com/hadoop-swift/hadoop-swift-latest.jar
|
||||
:Description: Location of the Swift jar file.
|
||||
:Description: Location of the swift jar file.
|
||||
|
||||
HDFS_LIB_DIR
|
||||
DIB_HDFS_LIB_DIR
|
||||
:Required: No
|
||||
:Default: /usr/lib/hadoop
|
||||
:Description: Directory in the guest where to save the Swift jar.
|
||||
:Default: /usr/share/hadoop/lib
|
||||
:Description: Directory in the guest where to save the swift jar.
|
||||
|
||||
DIB_HADOOP_SWIFT_JAR_NAME
|
||||
:Required: No
|
||||
:Default: hadoop-swift.jar
|
||||
:Description: Filename of the deployed swift jar.
|
||||
|
|
|
@ -8,11 +8,12 @@ set -o pipefail
|
|||
|
||||
HDFS_LIB_DIR=${DIB_HDFS_LIB_DIR:-"/usr/share/hadoop/lib"}
|
||||
SWIFT_LIB_URI="http://sahara-files.mirantis.com/hadoop-swift/hadoop-swift-latest.jar"
|
||||
HADOOP_SWIFT_JAR_NAME=${DIB_HADOOP_SWIFT_JAR_NAME:-"hadoop-swift.jar"}
|
||||
|
||||
if [ -z "${swift_url:-}" ]; then
|
||||
wget -O $HDFS_LIB_DIR/hadoop-swift.jar $SWIFT_LIB_URI
|
||||
wget -O $HDFS_LIB_DIR/$HADOOP_SWIFT_JAR_NAME $SWIFT_LIB_URI
|
||||
else
|
||||
wget -O $HDFS_LIB_DIR/hadoop-swift.jar $swift_url
|
||||
wget -O $HDFS_LIB_DIR/$HADOOP_SWIFT_JAR_NAME $swift_url
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -20,4 +21,4 @@ if [ $? -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
chmod 0644 $HDFS_LIB_DIR/hadoop-swift.jar
|
||||
chmod 0644 $HDFS_LIB_DIR/$HADOOP_SWIFT_JAR_NAME
|
||||
|
|
Loading…
Reference in New Issue