Merge lp://staging/~bac/charms/oneiric/buildbot-slave/fix-apt-sources into lp://staging/~yellow/charms/oneiric/buildbot-slave/trunk

Proposed by Brad Crittenden
Status: Merged
Merged at revision: 26
Proposed branch: lp://staging/~bac/charms/oneiric/buildbot-slave/fix-apt-sources
Merge into: lp://staging/~yellow/charms/oneiric/buildbot-slave/trunk
Diff against target: 59 lines (+37/-0)
1 file modified
hooks/install (+37/-0)
To merge this branch: bzr merge lp://staging/~bac/charms/oneiric/buildbot-slave/fix-apt-sources
Reviewer Review Type Date Requested Status
Gary Poster (community) Approve
Review via email: mp+101007@code.staging.launchpad.net

Description of the change

Duplicated changes from the buildbot-master to redo /etc/apt/sources.list if there are problems.

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) :
review: Approve
Revision history for this message
Benji York (benji) wrote :

On Thu, Apr 5, 2012 at 1:18 PM, Brad Crittenden <email address hidden> wrote:
> Brad Crittenden has proposed merging lp:~bac/charms/oneiric/buildbot-slave/fix-apt-sources into lp:~yellow/charms/oneiric/buildbot-slave/trunk.

>  def install_packages():
> +    try:
> +        # Attempt exercising 'apt-get' to see if there are errors in the
> +        # repositories, as frequently seen on EC2.  If so, fix the apt sources
> +        # file.  This approach will work if the failure is seen initially but
> +        # will not succeed if it is intermittent.
> +        run('apt-get', 'update')
> +    except subprocess.CalledProcessError as e:
> +        log("Error running 'apt-get update':")
> +        log(str(e))
> +        log("Proceeding with re-written /etc/apt/sources.list")
> +        fix_apt_sources()
> +        run('apt-get', 'update')
>     install_extra_repository('ppa:yellow/ppa')
>     apt_get_install('python-shelltoolbox')

Since "apt-get update" returns a specific exit code (100) shouldn't we
only rewrite sources.list if it fails with that result?
--
Benji York

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: