Merge lp:~thedac/charms/precise/gunicorn/make-apt-install-fatal into lp:~charmers/charms/precise/gunicorn/trunk

Proposed by David Ames
Status: Rejected
Rejected by: Charles Butler
Proposed branch: lp:~thedac/charms/precise/gunicorn/make-apt-install-fatal
Merge into: lp:~charmers/charms/precise/gunicorn/trunk
Diff against target: 27 lines (+4/-4)
1 file modified
hooks/hooks.py (+4/-4)
To merge this branch: bzr merge lp:~thedac/charms/precise/gunicorn/make-apt-install-fatal
Reviewer Review Type Date Requested Status
Charles Butler (community) Disapprove
Tom Haddon Disapprove
Celso Providelo (community) Needs Information
Review via email: mp+221451@code.launchpad.net

Description of the change

Make fetch.apt_install() calls fatal on failure

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :

TBH, I wonder if it doesn't belong in the charmhelpers codebase, because it's seems to me that, considering the racing between the main and its subordinates charms, package installing should be retried by default. On 'main' charms the retrying would be rarely (never) reached.

Also, IMO, 'fatal' doesn't transmit well what the code does, A better alternative would be 'retry' which could modify the hardcoded "30 times 10s wait" retry behaviour or just stick more suitable defaults.

review: Needs Information
Revision history for this message
Tom Haddon (mthaddon) wrote :

The version of charmhelpers installed on the instance that failed didn't have the retry code in it . We should update the version of charmhelpers in the gunicorn charm so that it does have this (this was introduced in revno 149 of charmhelpers), and we should then be in good shape. See http://paste.ubuntu.com/7549696/

review: Disapprove
Revision history for this message
Charles Butler (lazypower) wrote :

David,

Thank you for this merge proposal, as Tom Haddon has recommended, there is retry code already baked into charmhelpers that superseeds the version embedded here. It would be a great idea to update that charm-helpers embedded lib and give it another go.

All the best,

Charles

review: Disapprove

Unmerged revisions

33. By David Ames

Make fetch.apt_install() calls fatal if they fail

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2014-05-01 13:14:53 +0000
3+++ hooks/hooks.py 2014-05-29 19:03:07 +0000
4@@ -54,7 +54,7 @@
5
6 def ensure_packages():
7 fetch.apt_update()
8- fetch.apt_install(CHARM_PACKAGES)
9+ fetch.apt_install(CHARM_PACKAGES, fatal = True)
10
11
12 def remove_old_services():
13@@ -138,11 +138,11 @@
14 wsgi_config[key] = relation_value
15
16 if wsgi_config['wsgi_worker_class'] == 'eventlet':
17- fetch.apt_install('python-eventlet')
18+ fetch.apt_install('python-eventlet', fatal = True)
19 elif wsgi_config['wsgi_worker_class'] == 'gevent':
20- fetch.apt_install('python-gevent')
21+ fetch.apt_install('python-gevent', fatal = True)
22 elif wsgi_config['wsgi_worker_class'] == 'tornado':
23- fetch.apt_install('python-tornado')
24+ fetch.apt_install('python-tornado', fatal = True)
25
26 if str(wsgi_config['wsgi_workers']) == '0':
27 wsgi_config['wsgi_workers'] = cpu_count() + 1

Subscribers

People subscribed via source and target branches

to all changes: