From 53b16c09e8c9cbe77c42c870c108481fa48c5d4e Mon Sep 17 00:00:00 2001 From: James Laska Date: Fri, 5 Jun 2015 12:46:07 -0400 Subject: [PATCH] Please don't hate on flake8 --- awx/api/views.py | 3 +-- awx/fact/__init__.py | 12 +++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/awx/api/views.py b/awx/api/views.py index f567b33246..1ffe8b1631 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -237,8 +237,7 @@ class ApiV1ConfigView(APIView): # Sanity check: If this license includes system tracking, make # sure that we have a valid MongoDB to point to, and complain if # we do not. - if (license_data['features']['system_tracking'] and - settings.MONGO_HOST == NotImplemented): # noqa + if (license_data['features']['system_tracking'] and settings.MONGO_HOST == NotImplemented): return Response({ 'error': 'This license supports system tracking, which ' 'requires MongoDB to be installed. Since you are ' diff --git a/awx/fact/__init__.py b/awx/fact/__init__.py index 0798f12d29..a0aead907d 100644 --- a/awx/fact/__init__.py +++ b/awx/fact/__init__.py @@ -20,14 +20,12 @@ try: raise ConnectionError # Attempt to connect to the MongoDB database. - # P.S. Flake8 is terrible. This indentation is consistent with PEP8. connect(settings.MONGO_DB, - host=settings.MONGO_HOST, # noqa - port=int(settings.MONGO_PORT), # noqa - username=settings.MONGO_USERNAME, # noqa - password=settings.MONGO_PASSWORD, # noqa - tz_aware=settings.USE_TZ, # noqa - ) # noqa + host=settings.MONGO_HOST, + port=int(settings.MONGO_PORT), + username=settings.MONGO_USERNAME, + password=settings.MONGO_PASSWORD, + tz_aware=settings.USE_TZ) register_key_transform(get_db()) except ConnectionError: logger.warn('Failed to establish connect to MongoDB "%s"' % (settings.MONGO_DB))