Merge lp:~marcoceppi/charms/trusty/mongodb/trunk into lp:charms/trusty/mongodb

Proposed by Marco Ceppi
Status: Merged
Merged at revision: 81
Proposed branch: lp:~marcoceppi/charms/trusty/mongodb/trunk
Merge into: lp:charms/trusty/mongodb
Diff against target: 32 lines (+7/-8)
1 file modified
hooks/hooks.py (+7/-8)
To merge this branch: bzr merge lp:~marcoceppi/charms/trusty/mongodb/trunk
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+280791@code.launchpad.net

Description of the change

Address hooks failing in restricted network

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #15552 mongodb for marcoceppi mp280791
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/15552/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #14512 mongodb for marcoceppi mp280791
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/14512/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8322 mongodb for marcoceppi mp280791
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/8322/

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 2015-12-16 20:22:02 +0000
3+++ hooks/hooks.py 2015-12-17 02:23:58 +0000
4@@ -88,14 +88,6 @@
5 apt_install("python-lockfile", fatal=True)
6 from lockfile import FileLock
7
8-try:
9- from charms.benchmark import Benchmark
10-except ImportError:
11- apt_install('python-pip', fatal=True)
12- import subprocess
13- subprocess.check_call(['pip', 'install', '-U', 'charms.benchmark'])
14- from charms.benchmark import Benchmark
15-
16 from charmhelpers.contrib.charmsupport.nrpe import NRPE
17
18 hooks = Hooks()
19@@ -1117,6 +1109,13 @@
20 @hooks.hook('benchmark-relation-changed')
21 def benchmark_relation_joined():
22 juju_log('benchmark-relation-joined')
23+ try:
24+ from charms.benchmark import Benchmark
25+ except ImportError:
26+ apt_install('python-pip', fatal=True)
27+ import subprocess
28+ subprocess.check_call(['pip', 'install', '-U', 'charms.benchmark'])
29+ from charms.benchmark import Benchmark
30
31 # Send a list of benchmark-enabled actions for display in the benchmark-gui
32 benchmarks = ['perf']

Subscribers

People subscribed via source and target branches