mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Please don't hate on flake8
This commit is contained in:
@@ -237,8 +237,7 @@ class ApiV1ConfigView(APIView):
|
|||||||
# Sanity check: If this license includes system tracking, make
|
# Sanity check: If this license includes system tracking, make
|
||||||
# sure that we have a valid MongoDB to point to, and complain if
|
# sure that we have a valid MongoDB to point to, and complain if
|
||||||
# we do not.
|
# we do not.
|
||||||
if (license_data['features']['system_tracking'] and
|
if (license_data['features']['system_tracking'] and settings.MONGO_HOST == NotImplemented):
|
||||||
settings.MONGO_HOST == NotImplemented): # noqa
|
|
||||||
return Response({
|
return Response({
|
||||||
'error': 'This license supports system tracking, which '
|
'error': 'This license supports system tracking, which '
|
||||||
'requires MongoDB to be installed. Since you are '
|
'requires MongoDB to be installed. Since you are '
|
||||||
|
|||||||
@@ -20,14 +20,12 @@ try:
|
|||||||
raise ConnectionError
|
raise ConnectionError
|
||||||
|
|
||||||
# Attempt to connect to the MongoDB database.
|
# Attempt to connect to the MongoDB database.
|
||||||
# P.S. Flake8 is terrible. This indentation is consistent with PEP8.
|
|
||||||
connect(settings.MONGO_DB,
|
connect(settings.MONGO_DB,
|
||||||
host=settings.MONGO_HOST, # noqa
|
host=settings.MONGO_HOST,
|
||||||
port=int(settings.MONGO_PORT), # noqa
|
port=int(settings.MONGO_PORT),
|
||||||
username=settings.MONGO_USERNAME, # noqa
|
username=settings.MONGO_USERNAME,
|
||||||
password=settings.MONGO_PASSWORD, # noqa
|
password=settings.MONGO_PASSWORD,
|
||||||
tz_aware=settings.USE_TZ, # noqa
|
tz_aware=settings.USE_TZ)
|
||||||
) # noqa
|
|
||||||
register_key_transform(get_db())
|
register_key_transform(get_db())
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
logger.warn('Failed to establish connect to MongoDB "%s"' % (settings.MONGO_DB))
|
logger.warn('Failed to establish connect to MongoDB "%s"' % (settings.MONGO_DB))
|
||||||
|
|||||||
Reference in New Issue
Block a user