Merge pull request #22568 from jfindlay/nado_lint

saltnado lint
This commit is contained in:
Justin Findlay 2015-04-12 17:20:06 -06:00
commit 544bdbcf1f
3 changed files with 13 additions and 23 deletions

View File

@ -360,22 +360,12 @@ def get_batch_size(batch, num_minions):
'of %10, 10% or 3').format(batch))
class BaseSaltAPIHandler(tornado.web.RequestHandler, SaltClientsMixIn):
class BaseSaltAPIHandler(tornado.web.RequestHandler, SaltClientsMixIn): # pylint: disable=W0223
ct_out_map = (
('application/json', json.dumps),
('application/x-yaml', yaml.safe_dump),
)
def min_syndic_wait_done(self):
'''
Ensure that the request has been open for a minimum of syndic_wait time
'''
if not self.application.opts['order_masters']:
return True
elif time.time() > self.start + self.application.opts['syndic_wait']:
return True
return False
def _verify_client(self, client):
'''
Verify that the client is in fact one we have
@ -507,7 +497,7 @@ class BaseSaltAPIHandler(tornado.web.RequestHandler, SaltClientsMixIn):
return lowstate
class SaltAuthHandler(BaseSaltAPIHandler):
class SaltAuthHandler(BaseSaltAPIHandler): # pylint: disable=W0223
'''
Handler for login requests
'''
@ -662,7 +652,7 @@ class SaltAuthHandler(BaseSaltAPIHandler):
self.write(self.serialize(ret))
class SaltAPIHandler(BaseSaltAPIHandler, SaltClientsMixIn):
class SaltAPIHandler(BaseSaltAPIHandler, SaltClientsMixIn): # pylint: disable=W0223
'''
Main API handler for base "/"
'''
@ -1013,7 +1003,7 @@ class SaltAPIHandler(BaseSaltAPIHandler, SaltClientsMixIn):
raise tornado.gen.Return('Timeout waiting for runner to execute')
class MinionSaltAPIHandler(SaltAPIHandler):
class MinionSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
'''
A convenience endpoint for minion related functions
'''
@ -1142,7 +1132,7 @@ class MinionSaltAPIHandler(SaltAPIHandler):
self.disbatch()
class JobsSaltAPIHandler(SaltAPIHandler):
class JobsSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
'''
A convenience endpoint for job cache data
'''
@ -1248,7 +1238,7 @@ class JobsSaltAPIHandler(SaltAPIHandler):
self.disbatch()
class RunSaltAPIHandler(SaltAPIHandler):
class RunSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
'''
Endpoint to run commands without normal session handling
'''
@ -1312,7 +1302,7 @@ class RunSaltAPIHandler(SaltAPIHandler):
self.disbatch()
class EventsSaltAPIHandler(SaltAPIHandler):
class EventsSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
'''
Expose the Salt event bus
@ -1440,7 +1430,7 @@ class EventsSaltAPIHandler(SaltAPIHandler):
break
class WebhookSaltAPIHandler(SaltAPIHandler):
class WebhookSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223
'''
A generic web hook entry point that fires an event on Salt's event bus

View File

@ -305,11 +305,11 @@ import logging
logger = logging.getLogger()
class AllEventsHandler(tornado.websocket.WebSocketHandler): # pylint: disable=W0232
class AllEventsHandler(tornado.websocket.WebSocketHandler): # pylint: disable=W0223,W0232
'''
Server side websocket handler.
'''
def open(self, token):
def open(self, token): # pylint: disable=W0221
'''
Return a websocket connection to Salt
representing Salt's "real time" event stream.
@ -363,7 +363,7 @@ class AllEventsHandler(tornado.websocket.WebSocketHandler): # pylint: disable=W
self.close()
class FormattedEventsHandler(AllEventsHandler): # pylint: disable=W0232
class FormattedEventsHandler(AllEventsHandler): # pylint: disable=W0223,W0232
@tornado.gen.coroutine
def on_message(self, message):

View File

@ -37,7 +37,7 @@ from salt.ext.six.moves.urllib.parse import urlencode # pylint: disable=no-name
# pylint: enable=import-error
@skipIf(HAS_TORNADO is False, 'The tornado package needs to be installed')
@skipIf(HAS_TORNADO is False, 'The tornado package needs to be installed') # pylint: disable=W0223
class SaltnadoTestCase(integration.ModuleCase, AsyncHTTPTestCase):
'''
Mixin to hold some shared things
@ -73,7 +73,7 @@ class SaltnadoTestCase(integration.ModuleCase, AsyncHTTPTestCase):
class TestBaseSaltAPIHandler(SaltnadoTestCase):
def get_app(self):
class StubHandler(saltnado.BaseSaltAPIHandler):
class StubHandler(saltnado.BaseSaltAPIHandler): # pylint: disable=W0223
def get(self):
return self.echo_stuff()