Merge lp:~gnuoy/charms/trusty/mysql/fix-source into lp:charms/trusty/mysql

Proposed by Liam Young
Status: Merged
Merged at revision: 129
Proposed branch: lp:~gnuoy/charms/trusty/mysql/fix-source
Merge into: lp:charms/trusty/mysql
Diff against target: 87 lines (+20/-4)
4 files modified
hooks/charmhelpers/core/hookenv.py (+6/-0)
hooks/charmhelpers/core/host.py (+8/-2)
hooks/charmhelpers/core/services/__init__.py (+2/-2)
hooks/charmhelpers/fetch/__init__.py (+4/-0)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/mysql/fix-source
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+239344@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/charmhelpers/core/hookenv.py'
2--- hooks/charmhelpers/core/hookenv.py 2014-09-26 07:17:08 +0000
3+++ hooks/charmhelpers/core/hookenv.py 2014-10-23 08:13:57 +0000
4@@ -214,6 +214,12 @@
5 except KeyError:
6 return (self._prev_dict or {})[key]
7
8+ def keys(self):
9+ prev_keys = []
10+ if self._prev_dict is not None:
11+ prev_keys = self._prev_dict.keys()
12+ return list(set(prev_keys + dict.keys(self)))
13+
14 def load_previous(self, path=None):
15 """Load previous copy of config from disk.
16
17
18=== modified file 'hooks/charmhelpers/core/host.py'
19--- hooks/charmhelpers/core/host.py 2014-09-26 07:17:08 +0000
20+++ hooks/charmhelpers/core/host.py 2014-10-23 08:13:57 +0000
21@@ -6,13 +6,13 @@
22 # Matthew Wedgwood <matthew.wedgwood@canonical.com>
23
24 import os
25+import re
26 import pwd
27 import grp
28 import random
29 import string
30 import subprocess
31 import hashlib
32-import shutil
33 from contextlib import contextmanager
34
35 from collections import OrderedDict
36@@ -317,7 +317,13 @@
37 ip_output = (line for line in ip_output if line)
38 for line in ip_output:
39 if line.split()[1].startswith(int_type):
40- interfaces.append(line.split()[1].replace(":", ""))
41+ matched = re.search('.*: (bond[0-9]+\.[0-9]+)@.*', line)
42+ if matched:
43+ interface = matched.groups()[0]
44+ else:
45+ interface = line.split()[1].replace(":", "")
46+ interfaces.append(interface)
47+
48 return interfaces
49
50
51
52=== modified file 'hooks/charmhelpers/core/services/__init__.py'
53--- hooks/charmhelpers/core/services/__init__.py 2014-09-26 07:17:08 +0000
54+++ hooks/charmhelpers/core/services/__init__.py 2014-10-23 08:13:57 +0000
55@@ -1,2 +1,2 @@
56-from .base import *
57-from .helpers import *
58+from .base import * # NOQA
59+from .helpers import * # NOQA
60
61=== modified file 'hooks/charmhelpers/fetch/__init__.py'
62--- hooks/charmhelpers/fetch/__init__.py 2014-09-26 07:17:08 +0000
63+++ hooks/charmhelpers/fetch/__init__.py 2014-10-23 08:13:57 +0000
64@@ -72,6 +72,7 @@
65 FETCH_HANDLERS = (
66 'charmhelpers.fetch.archiveurl.ArchiveUrlFetchHandler',
67 'charmhelpers.fetch.bzrurl.BzrUrlFetchHandler',
68+ 'charmhelpers.fetch.giturl.GitUrlFetchHandler',
69 )
70
71 APT_NO_LOCK = 100 # The return code for "couldn't acquire lock" in APT.
72@@ -218,6 +219,7 @@
73 pocket for the release.
74 'cloud:' may be used to activate official cloud archive pockets,
75 such as 'cloud:icehouse'
76+ 'distro' may be used as a noop
77
78 @param key: A key to be added to the system's APT keyring and used
79 to verify the signatures on packages. Ideally, this should be an
80@@ -251,6 +253,8 @@
81 release = lsb_release()['DISTRIB_CODENAME']
82 with open('/etc/apt/sources.list.d/proposed.list', 'w') as apt:
83 apt.write(PROPOSED_POCKET.format(release))
84+ elif source == 'distro':
85+ pass
86 else:
87 raise SourceConfigError("Unknown source: {!r}".format(source))
88

Subscribers

People subscribed via source and target branches

to all changes: