summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-05-18 14:24:40 +0000
committerGerrit Code Review <review@openstack.org>2016-05-18 14:24:40 +0000
commit075be84738c7017c762e42b5b7eebc8a9a1d8d84 (patch)
treeb2ef9ee404a7db0bd042dfe0844ebf3266233d29
parent519f7ead61c4c509d9b273ebb3aae66ba80c6773 (diff)
parente363325c022d2901aede471fe0f66ae60e876f28 (diff)
downloadtrove-integration-075be84738c7017c762e42b5b7eebc8a9a1d8d84.tar.gz
Merge "Trove image build fails getting percona key"
-rwxr-xr-xscripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key15
-rwxr-xr-xscripts/files/elements/ubuntu-mysql/pre-install.d/10-percona-apt-key15
-rwxr-xr-xscripts/files/elements/ubuntu-percona/pre-install.d/10-percona-apt-key15
-rwxr-xr-xscripts/files/elements/ubuntu-pxc/pre-install.d/10-percona-apt-key15
4 files changed, 60 insertions, 0 deletions
diff --git a/scripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key b/scripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key
index fe773d7..ec1d89d 100755
--- a/scripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key
+++ b/scripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key
@@ -12,8 +12,23 @@ set -o xtrace
# Add Percona GPG key
mkdir -p /home/${GUEST_USERNAME}/.gnupg
+# sometimes the primary key server is unavailable and we should try an
+# alternate. see
+# https://bugs.launchpad.net/percona-server/+bug/907789. Disable
+# shell errexit so we can interrogate the exit code and take action
+# based on the exit code. We will reenable it later.
+set +e
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
+if [ "$?" -ne "0" ];
+then
+ echo "Trying alternate keyserver hkp://keyserver.ubuntu.com"
+ set -e
+ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A
+fi
+
+set -e
+
# Add Percona repo
# Creates the Percona sources list
cat <<EOL > /etc/apt/sources.list.d/percona.list
diff --git a/scripts/files/elements/ubuntu-mysql/pre-install.d/10-percona-apt-key b/scripts/files/elements/ubuntu-mysql/pre-install.d/10-percona-apt-key
index 159e6a7..2a03ad5 100755
--- a/scripts/files/elements/ubuntu-mysql/pre-install.d/10-percona-apt-key
+++ b/scripts/files/elements/ubuntu-mysql/pre-install.d/10-percona-apt-key
@@ -12,8 +12,23 @@ set -o xtrace
# Add Percona GPG key
mkdir -p /home/${GUEST_USERNAME}/.gnupg
+# sometimes the primary key server is unavailable and we should try an
+# alternate. see
+# https://bugs.launchpad.net/percona-server/+bug/907789. Disable
+# shell errexit so we can interrogate the exit code and take action
+# based on the exit code. We will reenable it later.
+set +e
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
+if [ "$?" -ne "0" ];
+then
+ echo "Trying alternate keyserver hkp://keyserver.ubuntu.com"
+ set -e
+ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A
+fi
+
+set -e
+
# Add Percona repo
# Creates the percona sources list
cat <<EOL > /etc/apt/sources.list.d/percona.list
diff --git a/scripts/files/elements/ubuntu-percona/pre-install.d/10-percona-apt-key b/scripts/files/elements/ubuntu-percona/pre-install.d/10-percona-apt-key
index 7db291c..c2b686c 100755
--- a/scripts/files/elements/ubuntu-percona/pre-install.d/10-percona-apt-key
+++ b/scripts/files/elements/ubuntu-percona/pre-install.d/10-percona-apt-key
@@ -14,8 +14,23 @@ if [ ! -e /home/${GUEST_USERNAME}/.gnupg ]; then
mkdir -p /home/${GUEST_USERNAME}/.gnupg
fi
+# sometimes the primary key server is unavailable and we should try an
+# alternate. see
+# https://bugs.launchpad.net/percona-server/+bug/907789. Disable
+# shell errexit so we can interrogate the exit code and take action
+# based on the exit code. We will reenable it later.
+set +e
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
+if [ "$?" -ne "0" ];
+then
+ echo "Trying alternate keyserver hkp://keyserver.ubuntu.com"
+ set -e
+ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A
+fi
+
+set -e
+
# add Percona repo
# creates the percona sources list
cat <<EOL > /etc/apt/sources.list.d/percona.list
diff --git a/scripts/files/elements/ubuntu-pxc/pre-install.d/10-percona-apt-key b/scripts/files/elements/ubuntu-pxc/pre-install.d/10-percona-apt-key
index 7db291c..c2b686c 100755
--- a/scripts/files/elements/ubuntu-pxc/pre-install.d/10-percona-apt-key
+++ b/scripts/files/elements/ubuntu-pxc/pre-install.d/10-percona-apt-key
@@ -14,8 +14,23 @@ if [ ! -e /home/${GUEST_USERNAME}/.gnupg ]; then
mkdir -p /home/${GUEST_USERNAME}/.gnupg
fi
+# sometimes the primary key server is unavailable and we should try an
+# alternate. see
+# https://bugs.launchpad.net/percona-server/+bug/907789. Disable
+# shell errexit so we can interrogate the exit code and take action
+# based on the exit code. We will reenable it later.
+set +e
apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
+if [ "$?" -ne "0" ];
+then
+ echo "Trying alternate keyserver hkp://keyserver.ubuntu.com"
+ set -e
+ apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A
+fi
+
+set -e
+
# add Percona repo
# creates the percona sources list
cat <<EOL > /etc/apt/sources.list.d/percona.list