[mod] continue with pep8

This commit is contained in:
Laurent Peuch 2016-12-18 01:49:31 +01:00
parent 7ce3981db1
commit f931976667
6 changed files with 7 additions and 7 deletions

View file

@ -2,4 +2,4 @@ language: python
install: "pip install pep8"
python:
- "2.7"
script: "pep8 --ignore E501,E128 moulinette"
script: "pep8 --ignore E501,E128,E731 moulinette"

View file

@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
from moulinette.core import init_interface, MoulinetteError
__title__ = 'moulinette'
__version__ = '0.1'
__author__ = ['Kload',
@ -29,8 +31,6 @@ __all__ = [
'init_interface', 'MoulinetteError',
]
from moulinette.core import init_interface, MoulinetteError
# Package functions

View file

@ -154,7 +154,7 @@ class BaseAuthenticator(object):
gpg.encoding = 'utf-8'
decrypted = gpg.decrypt(enc_pwd, passphrase=session_hash)
if decrypted.ok != True:
if decrypted.ok is not True:
logger.error("unable to decrypt password for the session: %s",
decrypted.status)
raise MoulinetteError(errno.EINVAL,

View file

@ -49,7 +49,7 @@ class Package(object):
self._cachedir = package.cachedir
def __setattr__(self, name, value):
if name[0] == '_' and self.__dict__.has_key(name):
if name[0] == '_' and name in self.__dict__:
# Deny reassignation of package directories
logger.error("cannot reassign Package variable '%s'", name)
return

View file

@ -254,7 +254,7 @@ class BaseActionsMapParser(object):
else:
if ifaces == 'all':
conf['authenticate'] = ifaces
elif ifaces == False:
elif ifaces is False:
conf['authenticate'] = False
elif isinstance(ifaces, list):
# Store only if authentication is needed

View file

@ -101,7 +101,7 @@ class MoulinetteLogger(Logger):
"""Append action_id if available to the extra."""
if self.action_id is not None:
extra = kwargs.get('extra', {})
if not 'action_id' in extra:
if 'action_id' not in extra:
# FIXME: Get real action_id instead of logger/current one
extra['action_id'] = _get_action_id()
kwargs['extra'] = extra