Merge lp:~james-page/charm-helpers/fixup_hahelpers into lp:charm-helpers

Proposed by James Page
Status: Merged
Approved by: Adam Gandelman
Approved revision: 25
Merged at revision: 26
Proposed branch: lp:~james-page/charm-helpers/fixup_hahelpers
Merge into: lp:charm-helpers
Diff against target: 74 lines (+7/-6)
5 files modified
charmhelpers/contrib/hahelpers/apache_utils.py (+2/-2)
charmhelpers/contrib/hahelpers/ceph_utils.py (+1/-1)
charmhelpers/contrib/hahelpers/cluster_utils.py (+1/-1)
charmhelpers/contrib/hahelpers/haproxy_utils.py (+1/-1)
charmhelpers/contrib/hahelpers/utils.py (+2/-1)
To merge this branch: bzr merge lp:~james-page/charm-helpers/fixup_hahelpers
Reviewer Review Type Date Requested Status
Charm Helper Maintainers Pending
Review via email: mp+168873@code.launchpad.net

Description of the change

Fixup imports in hahelpers

The imports are all package local so no hahelper prefix required.

Also fixed up the get_host_ip function to not call unit_get in
the function definition, but in the function instead.

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 'charmhelpers/contrib/hahelpers/apache_utils.py'
2--- charmhelpers/contrib/hahelpers/apache_utils.py 2013-05-30 23:26:24 +0000
3+++ charmhelpers/contrib/hahelpers/apache_utils.py 2013-06-12 08:27:26 +0000
4@@ -8,7 +8,7 @@
5 # Adam Gandelman <adamg@ubuntu.com>
6 #
7
8-from hahelpers.utils import (
9+from utils import (
10 relation_ids,
11 relation_list,
12 relation_get,
13@@ -19,7 +19,7 @@
14 get_host_ip,
15 restart
16 )
17-from hahelpers.cluster_utils import https
18+from cluster_utils import https
19
20 import os
21 import subprocess
22
23=== modified file 'charmhelpers/contrib/hahelpers/ceph_utils.py'
24--- charmhelpers/contrib/hahelpers/ceph_utils.py 2013-05-30 23:26:24 +0000
25+++ charmhelpers/contrib/hahelpers/ceph_utils.py 2013-06-12 08:27:26 +0000
26@@ -12,7 +12,7 @@
27 import subprocess
28 import os
29 import shutil
30-import hahelpers.utils as utils
31+import utils
32
33 KEYRING = '/etc/ceph/ceph.client.%s.keyring'
34 KEYFILE = '/etc/ceph/ceph.client.%s.key'
35
36=== modified file 'charmhelpers/contrib/hahelpers/cluster_utils.py'
37--- charmhelpers/contrib/hahelpers/cluster_utils.py 2013-05-30 23:26:24 +0000
38+++ charmhelpers/contrib/hahelpers/cluster_utils.py 2013-06-12 08:27:26 +0000
39@@ -8,7 +8,7 @@
40 # Adam Gandelman <adamg@ubuntu.com>
41 #
42
43-from hahelpers.utils import (
44+from utils import (
45 juju_log,
46 relation_ids,
47 relation_list,
48
49=== modified file 'charmhelpers/contrib/hahelpers/haproxy_utils.py'
50--- charmhelpers/contrib/hahelpers/haproxy_utils.py 2013-05-30 23:26:24 +0000
51+++ charmhelpers/contrib/hahelpers/haproxy_utils.py 2013-06-12 08:27:26 +0000
52@@ -8,7 +8,7 @@
53 # Adam Gandelman <adamg@ubuntu.com>
54 #
55
56-from lib.utils import (
57+from utils import (
58 relation_ids,
59 relation_list,
60 relation_get,
61
62=== modified file 'charmhelpers/contrib/hahelpers/utils.py'
63--- charmhelpers/contrib/hahelpers/utils.py 2013-06-11 18:22:54 +0000
64+++ charmhelpers/contrib/hahelpers/utils.py 2013-06-12 08:27:26 +0000
65@@ -270,7 +270,8 @@
66
67
68 @cached
69-def get_host_ip(hostname=unit_get('private-address')):
70+def get_host_ip(hostname=None):
71+ hostname = hostname or unit_get('private-address')
72 try:
73 # Test to see if already an IPv4 address
74 socket.inet_aton(hostname)

Subscribers

People subscribed via source and target branches