Merge lp:~paulgear/charms/trusty/cassandra/devel into lp:charms/trusty/cassandra

Proposed by Paul Gear
Status: Merged
Merged at revision: 379
Proposed branch: lp:~paulgear/charms/trusty/cassandra/devel
Merge into: lp:charms/trusty/cassandra
Diff against target: 56 lines (+14/-4)
3 files modified
hooks/actions.py (+2/-4)
hooks/helpers.py (+2/-0)
hooks/hooks.py (+10/-0)
To merge this branch: bzr merge lp:~paulgear/charms/trusty/cassandra/devel
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
charmers Pending
Review via email: mp+298856@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Gear (paulgear) wrote :

Currently testing; please do not merge yet. This is merely here to easily share diffs against trunk.

385. By Paul Gear

Revert old version checks and let's just pretend DSE 5.0 == Cassandra 3.0

386. By Paul Gear

Remove debug logging now that DSE 5.0 == Cassandra 3.0 is confirmed

Revision history for this message
Paul Gear (paulgear) wrote :

This is passing in is-mojo-ci now. Tagging Stuart for review.

Revision history for this message
Paul Gear (paulgear) wrote :

To clarify the purpose of this branch, it's to fix the handling of DSE 5.0, and to make it possible to install everything via proxy in an egress-filtered environment (i.e. our CI).

Revision history for this message
Stuart Bishop (stub) wrote :

All good, bar a single pedantic point I don't really care about.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/actions.py'
2--- hooks/actions.py 2016-06-09 10:59:24 +0000
3+++ hooks/actions.py 2016-07-01 05:04:34 +0000
4@@ -133,10 +133,8 @@
5
6 @action
7 def set_proxy():
8- config = hookenv.config()
9- if config['http_proxy']:
10- os.environ['http_proxy'] = config['http_proxy']
11- os.environ['https_proxy'] = config['http_proxy']
12+ import hooks
13+ hooks.set_proxy()
14
15
16 @action
17
18=== modified file 'hooks/helpers.py'
19--- hooks/helpers.py 2016-06-09 10:59:24 +0000
20+++ hooks/helpers.py 2016-07-01 05:04:34 +0000
21@@ -324,6 +324,8 @@
22 dse_ver = get_package_version('dse-full')
23 if not dse_ver:
24 return None
25+ elif LooseVersion(dse_ver) >= LooseVersion('5.0'):
26+ return '3.0'
27 elif LooseVersion(dse_ver) >= LooseVersion('4.7'):
28 return '2.1'
29 else:
30
31=== modified file 'hooks/hooks.py'
32--- hooks/hooks.py 2016-02-26 16:47:03 +0000
33+++ hooks/hooks.py 2016-07-01 05:04:34 +0000
34@@ -18,12 +18,22 @@
35 from charmhelpers.core import hookenv
36
37
38+def set_proxy():
39+ import os
40+ config = hookenv.config()
41+ if config['http_proxy']:
42+ os.environ['ftp_proxy'] = config['http_proxy']
43+ os.environ['http_proxy'] = config['http_proxy']
44+ os.environ['https_proxy'] = config['http_proxy']
45+
46+
47 def bootstrap():
48 try:
49 import bcrypt # NOQA: flake8
50 import cassandra # NOQA: flake8
51 except ImportError:
52 packages = ['python3-bcrypt', 'python3-cassandra']
53+ set_proxy()
54 fetch.configure_sources(update=True)
55 fetch.apt_install(packages, fatal=True)
56 import bcrypt # NOQA: flake8

Subscribers

People subscribed via source and target branches

to all changes: