more pep8/pylint. all clean now

This commit is contained in:
Scott Moser
2013-03-07 17:13:05 -05:00
parent 149b2480dd
commit 626d07a00e
8 changed files with 15 additions and 13 deletions

View File

@@ -56,7 +56,8 @@ class BootHookPartHandler(handlers.Handler):
util.write_file(filepath, contents, 0700) util.write_file(filepath, contents, 0700)
return filepath return filepath
def handle_part(self, _data, ctype, filename, payload, _frequency): def handle_part(self, _data, ctype, filename, # pylint: disable=W0221
payload, frequency): # pylint: disable=W0613
if ctype in handlers.CONTENT_SIGNALS: if ctype in handlers.CONTENT_SIGNALS:
return return

View File

@@ -46,7 +46,7 @@ class CloudConfigPartHandler(handlers.Handler):
handlers.type_from_starts_with("#cloud-config"), handlers.type_from_starts_with("#cloud-config"),
] ]
def _write_cloud_config(self, buf): def _write_cloud_config(self):
if not self.cloud_fn: if not self.cloud_fn:
return return
# Capture which files we merged from... # Capture which files we merged from...
@@ -107,12 +107,13 @@ class CloudConfigPartHandler(handlers.Handler):
self.cloud_buf = None self.cloud_buf = None
self.mergers = [DEF_MERGERS] self.mergers = [DEF_MERGERS]
def handle_part(self, _data, ctype, filename, payload, _freq, headers): def handle_part(self, _data, ctype, filename, # pylint: disable=W0221
payload, _frequency, headers): # pylint: disable=W0613
if ctype == handlers.CONTENT_START: if ctype == handlers.CONTENT_START:
self._reset() self._reset()
return return
if ctype == handlers.CONTENT_END: if ctype == handlers.CONTENT_END:
self._write_cloud_config(self.cloud_buf) self._write_cloud_config()
self._reset() self._reset()
return return
try: try:

View File

@@ -41,7 +41,8 @@ class ShellScriptPartHandler(handlers.Handler):
handlers.type_from_starts_with("#!"), handlers.type_from_starts_with("#!"),
] ]
def handle_part(self, _data, ctype, filename, payload, _frequency): def handle_part(self, _data, ctype, filename, # pylint: disable=W0221
payload, frequency): # pylint: disable=W0613
if ctype in handlers.CONTENT_SIGNALS: if ctype in handlers.CONTENT_SIGNALS:
# TODO(harlowja): maybe delete existing things here # TODO(harlowja): maybe delete existing things here
return return

View File

@@ -42,7 +42,8 @@ class UpstartJobPartHandler(handlers.Handler):
handlers.type_from_starts_with("#upstart-job"), handlers.type_from_starts_with("#upstart-job"),
] ]
def handle_part(self, _data, ctype, filename, payload, frequency): def handle_part(self, _data, ctype, filename, # pylint: disable=W0221
payload, frequency):
if ctype in handlers.CONTENT_SIGNALS: if ctype in handlers.CONTENT_SIGNALS:
return return

View File

@@ -152,5 +152,3 @@ def construct(parsed_mergers):
for (attr, opts) in mergers_to_be: for (attr, opts) in mergers_to_be:
mergers.append(attr(root, opts)) mergers.append(attr(root, opts))
return root return root

View File

@@ -22,7 +22,8 @@ class FakeModule(handlers.Handler):
def list_types(self): def list_types(self):
return self.types return self.types
def handle_part(self, data, ctype, filename, payload, frequency): def handle_part(self, _data, ctype, filename, # pylint: disable=W0221
payload, frequency):
pass pass

View File

@@ -140,4 +140,3 @@ class TestSimpleRun(helpers.MockerTestCase):
'e': 'f', 'e': 'f',
} }
}) })

View File

@@ -55,7 +55,7 @@ class TestConsumeUserData(helpers.FilesystemMockingTestCase):
#cloud-config #cloud-config
a: b a: b
e: f e: f
run: run:
- b - b
- c - c
''' '''
@@ -67,7 +67,7 @@ run:
#cloud-config #cloud-config
a: e a: e
e: g e: g
run: run:
- stuff - stuff
- morestuff - morestuff
''' '''
@@ -77,7 +77,7 @@ run:
blob3 = ''' blob3 = '''
#cloud-config #cloud-config
e: e:
- 1 - 1
- 2 - 2
- 3 - 3