From 86f9891f8f2027e31d7894842fec36b6962243c0 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Mon, 31 Jul 2023 20:37:37 -0400 Subject: [PATCH] fix linting (#14302) --- awx/main/access.py | 2 +- awx/main/utils/handlers.py | 4 ++-- awx/settings/development.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/awx/main/access.py b/awx/main/access.py index 096a485f49d7..277076d74149 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -368,7 +368,7 @@ def check_license(self, add_host_name=None, feature=None, check_expiration=True, report_violation = lambda message: logger.warning(message) if validation_info.get('trial', False) is True or validation_info['instance_count'] == 10: # basic 10 license - def report_violation(message): + def report_violation(message): # noqa raise PermissionDenied(message) if check_expiration and validation_info.get('time_remaining', None) is None: diff --git a/awx/main/utils/handlers.py b/awx/main/utils/handlers.py index aa32c77e8c7f..15343463e8d3 100644 --- a/awx/main/utils/handlers.py +++ b/awx/main/utils/handlers.py @@ -97,8 +97,6 @@ def emit(self, record): self.event_handler(dispatch_data) -ColorHandler = logging.StreamHandler - if settings.COLOR_LOGS is True: try: from logutils.colorize import ColorizingStreamHandler @@ -133,3 +131,5 @@ def format(self, record): except ImportError: # logutils is only used for colored logs in the dev environment pass +else: + ColorHandler = logging.StreamHandler diff --git a/awx/settings/development.py b/awx/settings/development.py index 6afd98a63c36..25ec408ad9d2 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -28,8 +28,8 @@ # show colored logs in the dev environment # to disable this, set `COLOR_LOGS = False` in awx/settings/local_settings.py -LOGGING['handlers']['console']['()'] = 'awx.main.utils.handlers.ColorHandler' # noqa COLOR_LOGS = True +LOGGING['handlers']['console']['()'] = 'awx.main.utils.handlers.ColorHandler' # noqa ALLOWED_HOSTS = ['*']