Fix new flake8 from pyflakes 2.2.0 release

This commit is contained in:
Christian Adams
2020-04-16 10:13:09 -04:00
parent e0c8f3e541
commit a899a147e1
13 changed files with 19 additions and 18 deletions

View File

@@ -22,7 +22,7 @@ class Scheduler(Scheduler):
def run():
ppid = os.getppid()
logger.warn(f'periodic beat started')
logger.warn('periodic beat started')
while True:
if os.getppid() != ppid:
# if the parent PID changes, this process has been orphaned

View File

@@ -123,9 +123,9 @@ class AWXConsumerRedis(AWXConsumerBase):
res = json.loads(res[1])
self.process_task(res)
except redis.exceptions.RedisError:
logger.exception(f"encountered an error communicating with redis")
logger.exception("encountered an error communicating with redis")
except (json.JSONDecodeError, KeyError):
logger.exception(f"failed to decode JSON message from redis")
logger.exception("failed to decode JSON message from redis")
if self.should_stop:
return

View File

@@ -91,7 +91,7 @@ class CallbackBrokerWorker(BaseWorker):
for e in events:
try:
if (
isinstance(exc, IntegrityError),
isinstance(exc, IntegrityError) and
getattr(e, 'host_id', '')
):
# this is one potential IntegrityError we can