Merge lp:~mbruzek/charms/trusty/mongodb/limited-network into lp:charms/trusty/mongodb

Proposed by Matt Bruzek
Status: Rejected
Rejected by: Marco Ceppi
Proposed branch: lp:~mbruzek/charms/trusty/mongodb/limited-network
Merge into: lp:charms/trusty/mongodb
Diff against target: 37 lines (+12/-2)
2 files modified
actions/perf (+6/-1)
hooks/hooks.py (+6/-1)
To merge this branch: bzr merge lp:~mbruzek/charms/trusty/mongodb/limited-network
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Disapprove
Kevin W Monroe Approve
Review via email: mp+280784@code.launchpad.net

Description of the change

An environment that has limited network capability found mongodb charm to be broken because it attempts to install charms.benchmark from pip.

The solution here is to continue to try to install from the Internet, when that fails pip install from a tar file in the charm directory.

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

LGTM pending a one line fix

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

charm_lint_check #15550 mongodb for mbruzek mp280784
    LINT OK: passed

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

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

charm_unit_test #14510 mongodb for mbruzek mp280784
    UNIT FAIL: unit-test failed

UNIT Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

Full unit test output: http://paste.ubuntu.com/14060740/
Build: http://10.245.162.77:8080/job/charm_unit_test/14510/

Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

filename needs a fixin, otherwise, +1.

83. By Matt Bruzek

Moving apt-get install pip outside of try catch!

84. By Matt Bruzek

Spelling the resource file name correctly would be helpful.

Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

LGTM!

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

charm_lint_check #15551 mongodb for mbruzek mp280784
    LINT OK: passed

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

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

charm_unit_test #14511 mongodb for mbruzek mp280784
    UNIT FAIL: unit-test failed

UNIT Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

Full unit test output: http://paste.ubuntu.com/14064877/
Build: http://10.245.162.77:8080/job/charm_unit_test/14511/

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

charm_amulet_test #8320 mongodb for mbruzek mp280784
    AMULET OK: passed

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

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

charm_amulet_test #8321 mongodb for mbruzek mp280784
    AMULET OK: passed

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

Revision history for this message
Marco Ceppi (marcoceppi) wrote :
review: Disapprove

Unmerged revisions

84. By Matt Bruzek

Spelling the resource file name correctly would be helpful.

83. By Matt Bruzek

Moving apt-get install pip outside of try catch!

82. By Matt Bruzek

Adding the charms.benchmark file for times when network is limited.

81. By Matt Bruzek

In network constrained environments you can not install from the Internet, use a file if all else fails.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'actions/perf'
2--- actions/perf 2015-12-02 22:44:28 +0000
3+++ actions/perf 2015-12-17 00:49:48 +0000
4@@ -11,7 +11,12 @@
5 from charms.benchmark import Benchmark
6 except ImportError:
7 subprocess.check_call(['apt-get', 'install', '-y', 'python-pip'])
8- subprocess.check_call(['pip', 'install', '-U', 'charms.benchmark'])
9+ try:
10+ subprocess.check_call(['pip', 'install', '-U', 'charms.benchmark'])
11+ except:
12+ # Using the Internet failed, install charms.benchmark from a file.
13+ benchmark_file = 'files/charms.benchmark-1.0.5.tar.gz'
14+ subprocess.check_call(['pip', 'install', '-U', benchmark_file])
15 from charms.benchmark import Benchmark
16
17
18
19=== added file 'files/charms.benchmark-1.0.5.tar.gz'
20Binary files files/charms.benchmark-1.0.5.tar.gz 1970-01-01 00:00:00 +0000 and files/charms.benchmark-1.0.5.tar.gz 2015-12-17 00:49:48 +0000 differ
21=== modified file 'hooks/hooks.py'
22--- hooks/hooks.py 2015-12-16 20:22:02 +0000
23+++ hooks/hooks.py 2015-12-17 00:49:48 +0000
24@@ -93,7 +93,12 @@
25 except ImportError:
26 apt_install('python-pip', fatal=True)
27 import subprocess
28- subprocess.check_call(['pip', 'install', '-U', 'charms.benchmark'])
29+ try:
30+ subprocess.check_call(['pip', 'install', '-U', 'charms.benchmark'])
31+ except:
32+ # Using the Internet failed, install charms.benchmark from a file.
33+ benchmark_file = 'files/charms.benchmark-1.0.5.tar.gz'
34+ subprocess.check_call(['pip', 'install', '-U', benchmark_file])
35 from charms.benchmark import Benchmark
36
37 from charmhelpers.contrib.charmsupport.nrpe import NRPE

Subscribers

People subscribed via source and target branches