Merge lp:~gandelman-a/charm-helpers/lint_clean into lp:charm-helpers

Proposed by Adam Gandelman
Status: Merged
Merged at revision: 66
Proposed branch: lp:~gandelman-a/charm-helpers/lint_clean
Merge into: lp:charm-helpers
Diff against target: 257 lines (+43/-50)
10 files modified
charmhelpers/contrib/ansible/__init__.py (+3/-3)
charmhelpers/contrib/charmhelpers/__init__.py (+20/-19)
charmhelpers/contrib/charmsupport/nrpe.py (+9/-8)
charmhelpers/contrib/jujugui/utils.py (+1/-1)
tests/contrib/ansible/test_ansible.py (+0/-2)
tests/contrib/charmhelpers/test_charmhelpers.py (+0/-1)
tests/contrib/jujugui/test_utils.py (+0/-1)
tests/contrib/saltstack/test_saltstates.py (+6/-11)
tests/contrib/templating/test_pyformat.py (+1/-1)
tests/core/test_hookenv.py (+3/-3)
To merge this branch: bzr merge lp:~gandelman-a/charm-helpers/lint_clean
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Adam Gandelman (community) Needs Resubmitting
Review via email: mp+175125@code.launchpad.net

Description of the change

Fixes all remaining lint issues, so we can start hopefully gating on $(make lint) == 0

To post a comment you must log in.
Revision history for this message
Liam Young (gnuoy) wrote :

There seems to be a text conflict in tests/contrib/saltstack/test_saltstates.py

review: Needs Fixing
56. By Adam Gandelman

Merge lp:charm-helpers.

57. By Adam Gandelman

Fix lint in newer tests.

58. By Adam Gandelman

More newer lint fixes.

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Rebased and rescrubbed.

review: Needs Resubmitting
Revision history for this message
Liam Young (gnuoy) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/ansible/__init__.py'
2--- charmhelpers/contrib/ansible/__init__.py 2013-07-25 08:02:54 +0000
3+++ charmhelpers/contrib/ansible/__init__.py 2013-08-07 17:07:26 +0000
4@@ -18,7 +18,7 @@
5 }}}
6
7 and won't need to change (nor will its tests) when you change the machine
8-state.
9+state.
10
11 All of your juju config and relation-data are available as template
12 variables within your playbooks and templates. An install playbook looks
13@@ -26,9 +26,9 @@
14
15 {{{
16 ---
17-- hosts: localhost
18+- hosts: localhost
19 user: root
20-
21+
22 tasks:
23 - name: Add private repositories.
24 template:
25
26=== modified file 'charmhelpers/contrib/charmhelpers/__init__.py'
27--- charmhelpers/contrib/charmhelpers/__init__.py 2013-05-19 18:17:25 +0000
28+++ charmhelpers/contrib/charmhelpers/__init__.py 2013-08-07 17:07:26 +0000
29@@ -8,25 +8,25 @@
30
31 __metaclass__ = type
32 __all__ = [
33- #'get_config', # core.hookenv.config()
34- #'log', # core.hookenv.log()
35- #'log_entry', # core.hookenv.log()
36- #'log_exit', # core.hookenv.log()
37- #'relation_get', # core.hookenv.relation_get()
38- #'relation_set', # core.hookenv.relation_set()
39- #'relation_ids', # core.hookenv.relation_ids()
40- #'relation_list', # core.hookenv.relation_units()
41- #'config_get', # core.hookenv.config()
42- #'unit_get', # core.hookenv.unit_get()
43- #'open_port', # core.hookenv.open_port()
44- #'close_port', # core.hookenv.close_port()
45- #'service_control', # core.host.service()
46- 'unit_info', # client-side, NOT IMPLEMENTED
47- 'wait_for_machine', # client-side, NOT IMPLEMENTED
48- 'wait_for_page_contents', # client-side, NOT IMPLEMENTED
49- 'wait_for_relation', # client-side, NOT IMPLEMENTED
50- 'wait_for_unit', # client-side, NOT IMPLEMENTED
51- ]
52+ #'get_config', # core.hookenv.config()
53+ #'log', # core.hookenv.log()
54+ #'log_entry', # core.hookenv.log()
55+ #'log_exit', # core.hookenv.log()
56+ #'relation_get', # core.hookenv.relation_get()
57+ #'relation_set', # core.hookenv.relation_set()
58+ #'relation_ids', # core.hookenv.relation_ids()
59+ #'relation_list', # core.hookenv.relation_units()
60+ #'config_get', # core.hookenv.config()
61+ #'unit_get', # core.hookenv.unit_get()
62+ #'open_port', # core.hookenv.open_port()
63+ #'close_port', # core.hookenv.close_port()
64+ #'service_control', # core.host.service()
65+ 'unit_info', # client-side, NOT IMPLEMENTED
66+ 'wait_for_machine', # client-side, NOT IMPLEMENTED
67+ 'wait_for_page_contents', # client-side, NOT IMPLEMENTED
68+ 'wait_for_relation', # client-side, NOT IMPLEMENTED
69+ 'wait_for_unit', # client-side, NOT IMPLEMENTED
70+]
71
72 import operator
73 from shelltoolbox import (
74@@ -54,6 +54,7 @@
75 # if update:
76 # run('apt-get', 'update')
77
78+
79 # DEPRECATED: client-side only
80 def make_charm_config_file(charm_config):
81 charm_config_file = tempfile.NamedTemporaryFile()
82
83=== modified file 'charmhelpers/contrib/charmsupport/nrpe.py'
84--- charmhelpers/contrib/charmsupport/nrpe.py 2013-05-16 21:48:30 +0000
85+++ charmhelpers/contrib/charmsupport/nrpe.py 2013-08-07 17:07:26 +0000
86@@ -13,12 +13,13 @@
87 import yaml
88
89 from charmhelpers.core.hookenv import (
90- config,
91- local_unit,
92- log,
93- relation_ids,
94- relation_set,
95- )
96+ config,
97+ local_unit,
98+ log,
99+ relation_ids,
100+ relation_set,
101+)
102+
103 from charmhelpers.core.host import service
104
105 # This module adds compatibility with the nrpe-external-master and plain nrpe
106@@ -164,7 +165,7 @@
107 'description': self.description,
108 'shortname': self.shortname,
109 'command': self.command,
110- }
111+ }
112 nrpe_service_text = Check.service_template.format(**templ_vars)
113 nrpe_service_file = '{}/service__{}_{}.cfg'.format(
114 NRPE.nagios_exportdir, hostname, self.command)
115@@ -209,7 +210,7 @@
116 nrpecheck.write(self.nagios_context, self.hostname)
117 nrpe_monitors[nrpecheck.shortname] = {
118 "command": nrpecheck.command,
119- }
120+ }
121
122 service('restart', 'nagios-nrpe-server')
123
124
125=== modified file 'charmhelpers/contrib/jujugui/utils.py'
126--- charmhelpers/contrib/jujugui/utils.py 2013-05-19 18:17:25 +0000
127+++ charmhelpers/contrib/jujugui/utils.py 2013-08-07 17:07:26 +0000
128@@ -90,7 +90,7 @@
129 JUJU_PEM = 'juju.includes-private-key.pem'
130 BUILD_REPOSITORIES = ('ppa:chris-lea/node.js-legacy',)
131 DEB_BUILD_DEPENDENCIES = (
132- 'bzr', 'imagemagick', 'make', 'nodejs', 'npm',
133+ 'bzr', 'imagemagick', 'make', 'nodejs', 'npm',
134 )
135 DEB_STAGE_DEPENDENCIES = (
136 'zookeeper',
137
138=== modified file 'tests/contrib/ansible/test_ansible.py'
139--- tests/contrib/ansible/test_ansible.py 2013-07-25 06:22:19 +0000
140+++ tests/contrib/ansible/test_ansible.py 2013-08-07 17:07:26 +0000
141@@ -26,7 +26,6 @@
142 self.mock_core = patcher.start()
143 self.addCleanup(patcher.stop)
144
145-
146 hosts_file = tempfile.NamedTemporaryFile()
147 self.ansible_hosts_path = hosts_file.name
148 self.addCleanup(hosts_file.close)
149@@ -100,7 +99,6 @@
150 patcher.start()
151 self.addCleanup(patcher.stop)
152
153-
154 def test_calls_ansible_playbook(self):
155 charmhelpers.contrib.ansible.apply_playbook(
156 'playbooks/dependencies.yaml')
157
158=== modified file 'tests/contrib/charmhelpers/test_charmhelpers.py'
159--- tests/contrib/charmhelpers/test_charmhelpers.py 2013-05-19 18:17:25 +0000
160+++ tests/contrib/charmhelpers/test_charmhelpers.py 2013-08-07 17:07:26 +0000
161@@ -70,7 +70,6 @@
162 self._make_juju_status_dict(
163 num_units, service_name, unit_state, machine_state))
164
165-
166 def test_make_charm_config_file(self):
167 # make_charm_config_file() writes the passed configuration to a
168 # temporary file as YAML.
169
170=== modified file 'tests/contrib/jujugui/test_utils.py'
171--- tests/contrib/jujugui/test_utils.py 2013-06-20 07:52:59 +0000
172+++ tests/contrib/jujugui/test_utils.py 2013-08-07 17:07:26 +0000
173@@ -4,7 +4,6 @@
174 import nose.plugins.attrib
175 import os
176 import shutil
177-from simplejson import dumps
178 from subprocess import CalledProcessError
179 import tempfile
180 import unittest
181
182=== modified file 'tests/contrib/saltstack/test_saltstates.py'
183--- tests/contrib/saltstack/test_saltstates.py 2013-07-25 06:22:19 +0000
184+++ tests/contrib/saltstack/test_saltstates.py 2013-08-07 17:07:26 +0000
185@@ -28,17 +28,13 @@
186 def test_adds_ppa_by_default(self):
187 charmhelpers.contrib.saltstack.install_salt_support()
188
189+ expected_calls = [((cmd,), {}) for cmd in [
190+ ['/usr/bin/add-apt-repository', '--yes', 'ppa:saltstack/salt'],
191+ ['/usr/bin/apt-get', 'update'],
192+ ]]
193 self.assertEqual(self.mock_subprocess.check_call.call_count, 2)
194- self.assertEqual([(([
195- '/usr/bin/add-apt-repository',
196- '--yes',
197- 'ppa:saltstack/salt',
198- ],), {}),
199- (([
200- '/usr/bin/apt-get',
201- 'update',
202- ],), {})
203- ], self.mock_subprocess.check_call.call_args_list)
204+ self.assertEqual(
205+ expected_calls, self.mock_subprocess.check_call.call_args_list)
206 self.mock_charmhelpers_core.host.apt_install.assert_called_once_with(
207 'salt-common')
208
209@@ -150,7 +146,6 @@
210 "local_unit": "click-index/3",
211 }, result)
212
213-
214 def test_output_with_relation(self):
215 self.mock_config.return_value = {
216 'group_code_owner': 'webops_deploy',
217
218=== modified file 'tests/contrib/templating/test_pyformat.py'
219--- tests/contrib/templating/test_pyformat.py 2013-07-09 10:45:37 +0000
220+++ tests/contrib/templating/test_pyformat.py 2013-08-07 17:07:26 +0000
221@@ -4,6 +4,7 @@
222 from charmhelpers.contrib.templating.pyformat import render
223 from charmhelpers.core import hookenv
224
225+
226 class PyFormatTest(TestCase):
227 @patch.object(hookenv, 'execution_environment')
228 def test_renders_using_environment(self, execution_environment):
229@@ -33,4 +34,3 @@
230
231 self.assertEqual(
232 render('foo is {foo}', extra=extra, foo='BAZ'), 'foo is BAZ')
233-
234
235=== modified file 'tests/core/test_hookenv.py'
236--- tests/core/test_hookenv.py 2013-07-18 16:13:49 +0000
237+++ tests/core/test_hookenv.py 2013-08-07 17:07:26 +0000
238@@ -486,16 +486,16 @@
239 'u0': {'key': 'val'},
240 'u1': {'key': 'val'},
241 'u2': {'key': 'val'},
242- },
243+ },
244 },
245 't2': {
246 'i1': {
247 'u0': {'key': 'val'},
248 'u1': {'key': 'val'},
249 'u2': {'key': 'val'},
250- },
251+ },
252 },
253- })
254+ })
255
256 @patch('charmhelpers.core.hookenv.config')
257 @patch('charmhelpers.core.hookenv.relation_type')

Subscribers

People subscribed via source and target branches