Add target for pep8 and lint, fix initial batch of issues
There are still quite a few lint errors to address but none of them seems critical.
This commit is contained in:
parent
acaf13220b
commit
7fb07ad480
10
Makefile
10
Makefile
|
@ -6,3 +6,13 @@ clean:
|
|||
sdist: clean
|
||||
python setup.py sdist --formats=gztar
|
||||
.PHONY: sdist
|
||||
|
||||
pep8:
|
||||
pep8 novajoin scripts
|
||||
|
||||
lint:
|
||||
pylint -d c,r,i,W0613 -r n -f colorized \
|
||||
--notes= \
|
||||
--ignored-classes=cherrypy,API \
|
||||
--disable=star-args \
|
||||
./novajoin
|
||||
|
|
|
@ -83,8 +83,7 @@ class JoinException(Exception):
|
|||
try:
|
||||
message = self.message % kwargs
|
||||
|
||||
except Exception:
|
||||
exc_info = sys.exc_info()
|
||||
except Exception: # pylint: disable=broad-except
|
||||
# kwargs doesn't match a variable in the message
|
||||
# log the issue and the kwargs
|
||||
LOG.exception('Exception in string format operation')
|
||||
|
|
|
@ -142,7 +142,7 @@ class GlanceImageService(object):
|
|||
params = self._extract_query_params(kwargs)
|
||||
try:
|
||||
images = self._client.call(context, 'list', **params)
|
||||
except Exception:
|
||||
except Exception: # pylint: disable=broad-except
|
||||
_reraise_translated_exception()
|
||||
else:
|
||||
if images is None:
|
||||
|
@ -204,7 +204,7 @@ class GlanceImageService(object):
|
|||
"""Returns a dict with image data for the given opaque image id."""
|
||||
try:
|
||||
image = self._client.call(context, 'get', image_id)
|
||||
except Exception:
|
||||
except Exception: # pylint: disable=broad-except
|
||||
_reraise_translated_image_exception(image_id)
|
||||
else:
|
||||
if image is None:
|
||||
|
|
|
@ -64,12 +64,12 @@ class IPANovaJoinBase(object):
|
|||
if 'version' not in kw:
|
||||
kw['version'] = u'2.146' # IPA v4.2.0 for compatibility
|
||||
try:
|
||||
result = api.Command[command](*args, **kw)
|
||||
api.Command[command](*args, **kw)
|
||||
except errors.CCacheError:
|
||||
LOG.debug("Refresh authentication")
|
||||
api.Backend.rpcclient.connect()
|
||||
self.__get_connection()
|
||||
result = api.Command[command](*args, **kw)
|
||||
api.Command[command](*args, **kw)
|
||||
|
||||
def _ipa_client_configured(self):
|
||||
"""
|
||||
|
|
|
@ -17,8 +17,6 @@ Simplified Common Auth Middleware from cinder.
|
|||
"""
|
||||
|
||||
|
||||
import os
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_middleware import request_id
|
||||
|
|
|
@ -19,9 +19,8 @@
|
|||
|
||||
import sys
|
||||
import time
|
||||
import json
|
||||
|
||||
from ipa import IPAClient
|
||||
from novajoin.ipa import IPAClient
|
||||
import oslo_messaging
|
||||
from neutronclient.v2_0 import client as neutron_client
|
||||
from novaclient import client as nova_client
|
||||
|
@ -71,7 +70,7 @@ class NotificationEndpoint(object):
|
|||
|
||||
def info(self, ctxt, publisher_id, event_type, payload, metadata):
|
||||
LOG.debug('notification:')
|
||||
LOG.debug(json.dumps(payload, indent=4))
|
||||
LOG.debug(jsonutils.dumps(payload, indent=4))
|
||||
|
||||
LOG.debug("publisher: %s, event: %s, metadata: %s", publisher_id,
|
||||
event_type, metadata)
|
||||
|
|
Loading…
Reference in New Issue