Prevent writing security repos twice in MapR plugin

Registration of precise and lucid security repos moved
to separate bash script which is executed only in case
of non-prebuilt images. Prebuilt images already contains
this repos.

Change-Id: I9151e1213b0fa75e4c7e8e16839d269d38a3adce
Closes-Bug: #1482237
This commit is contained in:
Artem Osadchyi 2015-08-07 12:39:30 +03:00
parent 427555e397
commit b330d50c28
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 _LW
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.mapreduce.mapreduce as mr
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_MYSQL_CLIENT = 'plugins/mapr/resources/install_mysql_client.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 = [
mng.Management(),
@ -107,6 +109,12 @@ class BaseConfigurer(ac.AbstractConfigurer):
def _prepare_bare_image(self, cluster_context, instances):
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
LOG.debug('Installing Java')

View File

@ -4,10 +4,6 @@ if [ "$1" = "Ubuntu" ]; then
cat >> /etc/apt/sources.list.d/maprtech.list << EOF
deb %(ubuntu_mapr_base_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
sudo apt-get install -y --force-yes wget
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