Merge lp:~freyes/charms/trusty/memcached/lp1636519 into lp:charms/trusty/memcached

Proposed by Felipe Reyes
Status: Merged
Merged at revision: 75
Proposed branch: lp:~freyes/charms/trusty/memcached/lp1636519
Merge into: lp:charms/trusty/memcached
Diff against target: 64 lines (+7/-7)
4 files modified
Makefile (+1/-1)
hooks/memcached_utils.py (+3/-3)
hooks/replication.py (+2/-2)
tests/10_deploy_test.py (+1/-1)
To merge this branch: bzr merge lp:~freyes/charms/trusty/memcached/lp1636519
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+309989@code.launchpad.net

Description of the change

  Fix bundletester execution

  - Makefile: check if 'charm' package exists, otherwise install it
  - memcached_utils: transform binary to utf-8 (python3 friendly)
  - replication: transform peer_ips() to list
  - 10_deploy_test.py: access the first unit through the list under sentry dict
    instead of assuming /0

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2015-06-30 14:17:25 +0000
3+++ Makefile 2016-11-03 17:42:01 +0000
4@@ -10,7 +10,7 @@
5 (which dh_clean && dh_clean) || true
6
7 .venv:
8- dpkg -l gcc python-dev python-virtualenv python-apt || sudo apt-get install -y gcc python-dev python-virtualenv python-apt
9+ dpkg -l gcc python-dev python-virtualenv python-apt charm || sudo apt-get install -y gcc python-dev python-virtualenv python-apt charm
10 virtualenv .venv --system-site-packages
11 .venv/bin/pip install -I -r test_requirements.txt
12
13
14=== modified file 'hooks/memcached_utils.py'
15--- hooks/memcached_utils.py 2015-07-06 21:30:20 +0000
16+++ hooks/memcached_utils.py 2016-11-03 17:42:01 +0000
17@@ -35,10 +35,10 @@
18
19 def dpkg_info_contains(package, key, value):
20 info = {}
21- dpkg = subprocess.check_output(
22- ['dpkg', '-s', package]).splitlines()
23+ log('dpkg -s %s' % package, level='DEBUG')
24+ dpkg = subprocess.check_output(['dpkg', '-s', package]).decode('utf-8')
25
26- for entry in dpkg:
27+ for entry in dpkg.splitlines():
28 entry = entry.split(':')
29 if len(entry) > 1:
30 info.update({entry[0].lower(): entry[1]})
31
32=== modified file 'hooks/replication.py'
33--- hooks/replication.py 2015-02-18 01:41:18 +0000
34+++ hooks/replication.py 2016-11-03 17:42:01 +0000
35@@ -41,7 +41,7 @@
36 log(msg, level='WARN')
37 else:
38 try:
39- peer_unit = peer_ips().values()[0]
40+ peer_unit = list(peer_ips().values())[0]
41
42 if oldest_peer(peers):
43 master, secondary = (unit_get('private-address'),
44@@ -70,7 +70,7 @@
45
46
47 def set_repcached_replica():
48- replica = peer_ips().values()[0]
49+ replica = list(peer_ips().values())[0]
50 log("Setting replica unit: %s" % replica)
51
52 master = unit_get('private-address')
53
54=== modified file 'tests/10_deploy_test.py'
55--- tests/10_deploy_test.py 2015-12-22 19:37:02 +0000
56+++ tests/10_deploy_test.py 2016-11-03 17:42:01 +0000
57@@ -140,7 +140,7 @@
58
59 # Test if the relation is complete and data was exchanged properly.
60
61-memcached_unit = d.sentry.unit['memcached/0']
62+memcached_unit = d.sentry['memcached'][0]
63 # Get the relation from memcached to mediawiki.
64 relation = memcached_unit.relation('cache', 'mediawiki:cache')
65

Subscribers

People subscribed via source and target branches