Merge "Prevent writing security repos twice in MapR plugin"

This commit is contained in:
Jenkins 2015-08-13 16:14:09 +00:00 committed by Gerrit Code Review
commit 81af38fabe
3 changed files with 14 additions and 4 deletions

View File

@ -24,6 +24,7 @@ from sahara import context
from sahara.i18n import _LI from sahara.i18n import _LI
from sahara.i18n import _LW from sahara.i18n import _LW
import sahara.plugins.mapr.abstract.configurer as ac import sahara.plugins.mapr.abstract.configurer as ac
from sahara.plugins.mapr.domain import distro as d
import sahara.plugins.mapr.services.management.management as mng import sahara.plugins.mapr.services.management.management as mng
import sahara.plugins.mapr.services.mapreduce.mapreduce as mr import sahara.plugins.mapr.services.mapreduce.mapreduce as mr
from sahara.plugins.mapr.services.maprfs import maprfs from sahara.plugins.mapr.services.maprfs import maprfs
@ -48,6 +49,7 @@ INSTALL_JAVA_SCRIPT = 'plugins/mapr/resources/install_java.sh'
INSTALL_SCALA_SCRIPT = 'plugins/mapr/resources/install_scala.sh' INSTALL_SCALA_SCRIPT = 'plugins/mapr/resources/install_scala.sh'
INSTALL_MYSQL_CLIENT = 'plugins/mapr/resources/install_mysql_client.sh' INSTALL_MYSQL_CLIENT = 'plugins/mapr/resources/install_mysql_client.sh'
ADD_MAPR_REPO_SCRIPT = 'plugins/mapr/resources/add_mapr_repo.sh' ADD_MAPR_REPO_SCRIPT = 'plugins/mapr/resources/add_mapr_repo.sh'
ADD_SECURITY_REPO_SCRIPT = 'plugins/mapr/resources/add_security_repos.sh'
SERVICE_INSTALL_PRIORITY = [ SERVICE_INSTALL_PRIORITY = [
mng.Management(), mng.Management(),
@ -107,6 +109,12 @@ class BaseConfigurer(ac.AbstractConfigurer):
def _prepare_bare_image(self, cluster_context, instances): def _prepare_bare_image(self, cluster_context, instances):
LOG.debug('Preparing bare image') LOG.debug('Preparing bare image')
if d.UBUNTU == cluster_context.distro:
LOG.debug("Installing security repos")
util.execute_on_instances(
instances, util.run_script, ADD_SECURITY_REPO_SCRIPT, 'root')
d_name = cluster_context.distro.name d_name = cluster_context.distro.name
LOG.debug('Installing Java') LOG.debug('Installing Java')

View File

@ -4,10 +4,6 @@ if [ "$1" = "Ubuntu" ]; then
cat >> /etc/apt/sources.list.d/maprtech.list << EOF cat >> /etc/apt/sources.list.d/maprtech.list << EOF
deb %(ubuntu_mapr_base_repo)s deb %(ubuntu_mapr_base_repo)s
deb %(ubuntu_mapr_ecosystem_repo)s deb %(ubuntu_mapr_ecosystem_repo)s
EOF
cat >> /etc/apt/sources.list.d/security_repo.list << EOF
deb http://security.ubuntu.com/ubuntu precise-security main
deb http://security.ubuntu.com/ubuntu lucid-security main
EOF EOF
sudo apt-get install -y --force-yes wget sudo apt-get install -y --force-yes wget
wget -O - http://package.mapr.com/releases/pub/maprgpg.key | sudo apt-key add - wget -O - http://package.mapr.com/releases/pub/maprgpg.key | sudo apt-key add -

View File

@ -0,0 +1,6 @@
#!/bin/sh
cat >> /etc/apt/sources.list.d/security_repo.list << EOF
deb http://security.ubuntu.com/ubuntu precise-security main
deb http://security.ubuntu.com/ubuntu lucid-security main
EOF