Unsupress pylint warnings.
The W291,W292,W391,W503,W601 warnings were fixed and tox.ini updated accordingly. Story: 2002803 Task: 26911 Change-Id: I1e5f0b1f72b06ad8b5cac07921e9d14171623ba0 Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
This commit is contained in:
parent
6c5b844111
commit
54f4802bb1
|
@ -349,7 +349,7 @@ class ServiceNodeController(rest.RestController):
|
||||||
# or service state are the same on both hosts
|
# or service state are the same on both hosts
|
||||||
if SM_SERVICE_GROUP_STATE_ACTIVE != sm_sda.state \
|
if SM_SERVICE_GROUP_STATE_ACTIVE != sm_sda.state \
|
||||||
and SM_SERVICE_GROUP_STATE_STANDBY != sm_sda.state \
|
and SM_SERVICE_GROUP_STATE_STANDBY != sm_sda.state \
|
||||||
and origin_state.has_key(sm_sda.service_group_name) \
|
and sm_sda.service_group_name in origin_state \
|
||||||
and origin_state[sm_sda.service_group_name] != sm_sda.state:
|
and origin_state[sm_sda.service_group_name] != sm_sda.state:
|
||||||
check_result = (
|
check_result = (
|
||||||
"%s on %s is not ready to take service, "
|
"%s on %s is not ready to take service, "
|
||||||
|
|
|
@ -73,18 +73,19 @@ class ParsableErrorMiddleware(object):
|
||||||
app_iter = self.app(environ, replacement_start_response)
|
app_iter = self.app(environ, replacement_start_response)
|
||||||
if (state['status_code'] / 100) not in (2, 3):
|
if (state['status_code'] / 100) not in (2, 3):
|
||||||
req = webob.Request(environ)
|
req = webob.Request(environ)
|
||||||
if (req.accept.best_match(['application/json', 'application/xml'])
|
if (req.accept.best_match(
|
||||||
== 'application/xml'):
|
['application/json', 'application/xml']) ==
|
||||||
|
'application/xml'):
|
||||||
try:
|
try:
|
||||||
# simple check xml is valid
|
# simple check xml is valid
|
||||||
body = [et.ElementTree.tostring(
|
body = [et.ElementTree.tostring(
|
||||||
et.ElementTree.fromstring('<error_message>'
|
et.ElementTree.fromstring('<error_message>' +
|
||||||
+ '\n'.join(app_iter)
|
'\n'.join(app_iter) +
|
||||||
+ '</error_message>'))]
|
'</error_message>'))]
|
||||||
except et.ElementTree.ParseError as err:
|
except et.ElementTree.ParseError as err:
|
||||||
LOG.error('Error parsing HTTP response: %s' % err)
|
LOG.error('Error parsing HTTP response: %s' % err)
|
||||||
body = ['<error_message>%s' % state['status_code']
|
body = ['<error_message>%s' % state['status_code'] +
|
||||||
+ '</error_message>']
|
'</error_message>']
|
||||||
state['headers'].append(('Content-Type', 'application/xml'))
|
state['headers'].append(('Content-Type', 'application/xml'))
|
||||||
else:
|
else:
|
||||||
body = [json.dumps({'error_message': '\n'.join(app_iter)})]
|
body = [json.dumps({'error_message': '\n'.join(app_iter)})]
|
||||||
|
|
|
@ -17,4 +17,3 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -17,4 +17,3 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ class FixedIntervalLoopingCall(LoopingCallBase):
|
||||||
delay = interval - timeutils.delta_seconds(start, end)
|
delay = interval - timeutils.delta_seconds(start, end)
|
||||||
if delay <= 0:
|
if delay <= 0:
|
||||||
LOG.warn(_('task run outlasted interval by %s sec') %
|
LOG.warn(_('task run outlasted interval by %s sec') %
|
||||||
-delay)
|
(delay * -1))
|
||||||
greenthread.sleep(delay if delay > 0 else 0)
|
greenthread.sleep(delay if delay > 0 else 0)
|
||||||
except LoopingCallDone as e:
|
except LoopingCallDone as e:
|
||||||
self.stop()
|
self.stop()
|
||||||
|
|
|
@ -15,4 +15,3 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -17,4 +17,3 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -104,8 +104,8 @@ def _check_for_lock():
|
||||||
if not CONF.debug:
|
if not CONF.debug:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if ((hasattr(local.strong_store, 'locks_held')
|
if ((hasattr(local.strong_store, 'locks_held') and
|
||||||
and local.strong_store.locks_held)):
|
local.strong_store.locks_held)):
|
||||||
stack = ' :: '.join([frame[3] for frame in inspect.stack()])
|
stack = ' :: '.join([frame[3] for frame in inspect.stack()])
|
||||||
LOG.warn(_('A RPC is being made while holding a lock. The locks '
|
LOG.warn(_('A RPC is being made while holding a lock. The locks '
|
||||||
'currently held are %(locks)s. This is probably a bug. '
|
'currently held are %(locks)s. This is probably a bug. '
|
||||||
|
|
|
@ -15,4 +15,3 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -15,4 +15,3 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -17,4 +17,3 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -18,4 +18,3 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
# Copyright (c) 2013-2014 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -61,5 +61,3 @@ def do_service_show(cc, args):
|
||||||
if getattr(service, 'node_name', None) is None:
|
if getattr(service, 'node_name', None) is None:
|
||||||
setattr(service, 'hostname', socket.gethostname())
|
setattr(service, 'hostname', socket.gethostname())
|
||||||
_print_service_show(service)
|
_print_service_show(service)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -65,4 +65,3 @@ def restart_service_safe(service_name):
|
||||||
service_name, SM_API_MSG_SKIP_DEP_CHECK))
|
service_name, SM_API_MSG_SKIP_DEP_CHECK))
|
||||||
|
|
||||||
_send_msg_to_sm(sm_api_msg)
|
_send_msg_to_sm(sm_api_msg)
|
||||||
|
|
||||||
|
|
|
@ -199,4 +199,3 @@ def main():
|
||||||
sys.stderr.close()
|
sys.stderr.close()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
7
tox.ini
7
tox.ini
|
@ -94,12 +94,6 @@ commands =
|
||||||
# H404: multi line docstring should start without a leading new line
|
# H404: multi line docstring should start without a leading new line
|
||||||
# H405: multi line docstring summary not separated with an empty line
|
# H405: multi line docstring summary not separated with an empty line
|
||||||
# H501: Do not use locals() for string formatting
|
# H501: Do not use locals() for string formatting
|
||||||
# - other warnings
|
|
||||||
# W291 trailing whitespace
|
|
||||||
# W292 no newline at end of file
|
|
||||||
# W391 blank line at end of file
|
|
||||||
# W503 line break before binary operator
|
|
||||||
# W601 .has_key() is deprecated, use 'in'
|
|
||||||
# - errors -
|
# - errors -
|
||||||
# F401 <foo> imported but unused
|
# F401 <foo> imported but unused
|
||||||
# F811 redefinition of unused '<foo>' from line <x>
|
# F811 redefinition of unused '<foo>' from line <x>
|
||||||
|
@ -117,7 +111,6 @@ commands =
|
||||||
ignore= E114,E116,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E201,E228,E231,E241,E251,E265,E271,
|
ignore= E114,E116,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E201,E228,E231,E241,E251,E265,E271,
|
||||||
E302,E303,E305,E402,E713,E714,E722,E731,E999,
|
E302,E303,E305,E402,E713,E714,E722,E731,E999,
|
||||||
H102,H104,H105,H106,H201,H231,H233,H236,H306,H401,H403,H404,H405,H501,
|
H102,H104,H105,H106,H201,H231,H233,H236,H306,H401,H403,H404,H405,H501,
|
||||||
W291,W292,W391,W503,W601,
|
|
||||||
F401,F811,F821,F841,
|
F401,F811,F821,F841,
|
||||||
B001,B004,B006,B007,B008,B303,B305,B306
|
B001,B004,B006,B007,B008,B303,B305,B306
|
||||||
# Enable checks which are off by default
|
# Enable checks which are off by default
|
||||||
|
|
Loading…
Reference in New Issue