Skip to content

Commit

Permalink
Change to offical repository after failing and retry installation on …
Browse files Browse the repository at this point in the history
…openjdk-7.
  • Loading branch information
yuyantingzero committed Mar 6, 2015
1 parent 1741bc4 commit 22214a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions perfkitbenchmarker/package_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def InstallPackages(self, packages):
'/usr/bin/apt-get -y install %s' % (packages))
self.RemoteCommand(install_command)
except errors.VmUtil.SshConnectionError as e:
self.RemoteCommand('sudo sed -i "s/azure.//g" /etc/apt/sources.list')
self.AptUpdate()
raise e

Expand Down
9 changes: 7 additions & 2 deletions perfkitbenchmarker/packages/openjdk7.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


"""Module containing OpenJDK7 installation and cleanup functions."""

from perfkitbenchmarker import errors

def YumInstall(vm):
"""Installs the OpenJDK7 package on the VM."""
Expand All @@ -23,4 +23,9 @@ def YumInstall(vm):

def AptInstall(vm):
"""Installs the OpenJDK7 package on the VM."""
vm.InstallPackages('openjdk-7-jdk')
try:
vm.InstallPackages('openjdk-7-jdk')
except errors.VmUtil.SshConnectionError as e:
# Using Ubuntu official repository and retry installation later.
vm.RemoteCommand('sudo sed -i "s/azure.//g" /etc/apt/sources.list')
raise e

0 comments on commit 22214a1

Please sign in to comment.