summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--awx/api/permissions.py1
-rw-r--r--awx/api/views/__init__.py3
-rw-r--r--awx/main/management/commands/bottleneck.py2
-rw-r--r--awx/main/migrations/_create_system_jobs.py2
-rw-r--r--awx/main/migrations/_galaxy.py2
-rw-r--r--awx/main/models/schedules.py2
-rw-r--r--awx/main/tests/functional/api/test_instance_group.py10
-rw-r--r--awx/main/tests/functional/api/test_schedules.py8
-rw-r--r--awx/main/tests/unit/api/test_views.py2
-rw-r--r--awx/playbooks/action_plugins/verify_project.py3
-rw-r--r--awx/settings/defaults.py2
-rw-r--r--awx/settings/production.py2
-rw-r--r--awx/sso/conf.py2
-rw-r--r--awx/sso/migrations/0003_convert_saml_string_to_list.py4
-rw-r--r--awx/sso/tests/functional/test_pipeline.py4
-rw-r--r--awx_collection/plugins/modules/project.py2
-rw-r--r--awx_collection/plugins/modules/workflow_job_template.py2
-rw-r--r--tox.ini2
18 files changed, 26 insertions, 29 deletions
diff --git a/awx/api/permissions.py b/awx/api/permissions.py
index 3608a23d33..c088f166d0 100644
--- a/awx/api/permissions.py
+++ b/awx/api/permissions.py
@@ -24,7 +24,6 @@ __all__ = [
'InventoryInventorySourcesUpdatePermission',
'UserPermission',
'IsSystemAdminOrAuditor',
- 'InstanceGroupTowerPermission',
'WorkflowApprovalPermission',
]
diff --git a/awx/api/views/__init__.py b/awx/api/views/__init__.py
index ee9f1021b5..537533a260 100644
--- a/awx/api/views/__init__.py
+++ b/awx/api/views/__init__.py
@@ -3096,8 +3096,7 @@ class WorkflowJobNodeChildrenBaseList(SubListAPIView):
search_fields = ('unified_job_template__name', 'unified_job_template__description')
#
- # Limit the set of WorkflowJobeNodes to the related nodes of specified by
- #'relationship'
+ # Limit the set of WorkflowJobNodes to the related nodes of specified by self.relationship
#
def get_queryset(self):
parent = self.get_parent_object()
diff --git a/awx/main/management/commands/bottleneck.py b/awx/main/management/commands/bottleneck.py
index a2a472e3e7..b43e19a20a 100644
--- a/awx/main/management/commands/bottleneck.py
+++ b/awx/main/management/commands/bottleneck.py
@@ -25,7 +25,7 @@ class Command(BaseCommand):
with connection.cursor() as cursor:
cursor.execute(
f'''
- SELECT
+ SELECT
b.id, b.job_id, b.host_name, b.created - a.created delta,
b.task task,
b.event_data::json->'task_action' task_action,
diff --git a/awx/main/migrations/_create_system_jobs.py b/awx/main/migrations/_create_system_jobs.py
index d000b4f362..1154e6adce 100644
--- a/awx/main/migrations/_create_system_jobs.py
+++ b/awx/main/migrations/_create_system_jobs.py
@@ -4,7 +4,7 @@ from django.utils.timezone import now
logger = logging.getLogger('awx.main.migrations')
-__all__ = ['create_collection_jt', 'create_clearsessions_jt', 'create_cleartokens_jt']
+__all__ = ['create_clearsessions_jt', 'create_cleartokens_jt']
'''
These methods are called by migrations to create various system job templates
diff --git a/awx/main/migrations/_galaxy.py b/awx/main/migrations/_galaxy.py
index 6601fb3472..3a876f9022 100644
--- a/awx/main/migrations/_galaxy.py
+++ b/awx/main/migrations/_galaxy.py
@@ -44,7 +44,7 @@ def migrate_galaxy_settings(apps, schema_editor):
credential_type=galaxy_type,
inputs={'url': 'https://galaxy.ansible.com/'},
)
- except:
+ except Exception:
# Needed for new migrations, tests
public_galaxy_credential = Credential(
created=now(), modified=now(), name='Ansible Galaxy', managed=True, credential_type=galaxy_type, inputs={'url': 'https://galaxy.ansible.com/'}
diff --git a/awx/main/models/schedules.py b/awx/main/models/schedules.py
index 98c241059d..1ec5ed7d2b 100644
--- a/awx/main/models/schedules.py
+++ b/awx/main/models/schedules.py
@@ -153,7 +153,7 @@ class Schedule(PrimordialModel, LaunchTimeConfig):
#
# Find the DTSTART rule or raise an error, its usually the first rule but that is not strictly enforced
- start_date_rule = re.sub('^.*(DTSTART[^\s]+)\s.*$', r'\1', rrule)
+ start_date_rule = re.sub(r'^.*(DTSTART[^\s]+)\s.*$', r'\1', rrule)
if not start_date_rule:
raise ValueError('A DTSTART field needs to be in the rrule')
diff --git a/awx/main/tests/functional/api/test_instance_group.py b/awx/main/tests/functional/api/test_instance_group.py
index 530fea2c65..aa8204c6da 100644
--- a/awx/main/tests/functional/api/test_instance_group.py
+++ b/awx/main/tests/functional/api/test_instance_group.py
@@ -216,7 +216,7 @@ def test_instance_attach_to_instance_group(post, instance_group, node_type_insta
count = ActivityStream.objects.count()
- url = reverse(f'api:instance_group_instance_list', kwargs={'pk': instance_group.pk})
+ url = reverse('api:instance_group_instance_list', kwargs={'pk': instance_group.pk})
post(url, {'associate': True, 'id': instance.id}, admin, expect=204 if node_type != 'control' else 400)
new_activity = ActivityStream.objects.all()[count:]
@@ -240,7 +240,7 @@ def test_instance_unattach_from_instance_group(post, instance_group, node_type_i
count = ActivityStream.objects.count()
- url = reverse(f'api:instance_group_instance_list', kwargs={'pk': instance_group.pk})
+ url = reverse('api:instance_group_instance_list', kwargs={'pk': instance_group.pk})
post(url, {'disassociate': True, 'id': instance.id}, admin, expect=204 if node_type != 'control' else 400)
new_activity = ActivityStream.objects.all()[count:]
@@ -263,7 +263,7 @@ def test_instance_group_attach_to_instance(post, instance_group, node_type_insta
count = ActivityStream.objects.count()
- url = reverse(f'api:instance_instance_groups_list', kwargs={'pk': instance.pk})
+ url = reverse('api:instance_instance_groups_list', kwargs={'pk': instance.pk})
post(url, {'associate': True, 'id': instance_group.id}, admin, expect=204 if node_type != 'control' else 400)
new_activity = ActivityStream.objects.all()[count:]
@@ -287,7 +287,7 @@ def test_instance_group_unattach_from_instance(post, instance_group, node_type_i
count = ActivityStream.objects.count()
- url = reverse(f'api:instance_instance_groups_list', kwargs={'pk': instance.pk})
+ url = reverse('api:instance_instance_groups_list', kwargs={'pk': instance.pk})
post(url, {'disassociate': True, 'id': instance_group.id}, admin, expect=204 if node_type != 'control' else 400)
new_activity = ActivityStream.objects.all()[count:]
@@ -314,4 +314,4 @@ def test_cannot_remove_controlplane_hybrid_instances(post, controlplane_instance
url = reverse('api:instance_instance_groups_list', kwargs={'pk': instance.pk})
r = post(url, {'disassociate': True, 'id': controlplane_instance_group.id}, admin_user, expect=400)
- assert f'Cannot disassociate hybrid instance' in str(r.data)
+ assert 'Cannot disassociate hybrid instance' in str(r.data)
diff --git a/awx/main/tests/functional/api/test_schedules.py b/awx/main/tests/functional/api/test_schedules.py
index 9bd85b3c0e..af5e28d3fc 100644
--- a/awx/main/tests/functional/api/test_schedules.py
+++ b/awx/main/tests/functional/api/test_schedules.py
@@ -123,19 +123,19 @@ def test_encrypted_survey_answer(post, patch, admin_user, project, inventory, su
("DTSTART:20030925T104941Z RRULE:FREQ=DAILY;INTERVAL=10;COUNT=500;UNTIL=20040925T104941Z", "RRULE may not contain both COUNT and UNTIL"), # noqa
("DTSTART:20300308T050000Z RRULE:FREQ=DAILY;INTERVAL=1;COUNT=2000", "COUNT > 999 is unsupported"), # noqa
# Individual rule test with multiple rules
- ## Bad Rule: RRULE:NONSENSE
+ # Bad Rule: RRULE:NONSENSE
("DTSTART:20300308T050000Z RRULE:NONSENSE RRULE:INTERVAL=1;FREQ=DAILY EXRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU", "INTERVAL required in rrule"),
- ## Bad Rule: RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=5MO
+ # Bad Rule: RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=5MO
(
"DTSTART:20300308T050000Z RRULE:INTERVAL=1;FREQ=DAILY EXRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=5MO",
"BYDAY with numeric prefix not supported",
), # noqa
- ## Bad Rule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=500;UNTIL=20040925T104941Z
+ # Bad Rule: RRULE:FREQ=DAILY;INTERVAL=10;COUNT=500;UNTIL=20040925T104941Z
(
"DTSTART:20030925T104941Z RRULE:INTERVAL=1;FREQ=DAILY EXRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU RRULE:FREQ=DAILY;INTERVAL=10;COUNT=500;UNTIL=20040925T104941Z",
"RRULE may not contain both COUNT and UNTIL",
), # noqa
- ## Bad Rule: RRULE:FREQ=DAILY;INTERVAL=1;COUNT=2000
+ # Bad Rule: RRULE:FREQ=DAILY;INTERVAL=1;COUNT=2000
(
"DTSTART:20300308T050000Z RRULE:INTERVAL=1;FREQ=DAILY EXRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU RRULE:FREQ=DAILY;INTERVAL=1;COUNT=2000",
"COUNT > 999 is unsupported",
diff --git a/awx/main/tests/unit/api/test_views.py b/awx/main/tests/unit/api/test_views.py
index e2a482e1dc..0620338783 100644
--- a/awx/main/tests/unit/api/test_views.py
+++ b/awx/main/tests/unit/api/test_views.py
@@ -23,7 +23,7 @@ class TestApiRootView:
endpoints = [
'ping',
'config',
- #'settings',
+ # 'settings',
'me',
'dashboard',
'organizations',
diff --git a/awx/playbooks/action_plugins/verify_project.py b/awx/playbooks/action_plugins/verify_project.py
index 0597d8b4b8..8df7c2edb4 100644
--- a/awx/playbooks/action_plugins/verify_project.py
+++ b/awx/playbooks/action_plugins/verify_project.py
@@ -5,7 +5,6 @@ __metaclass__ = type
import gnupg
import os
import tempfile
-from ansible.module_utils.basic import *
from ansible.plugins.action import ActionBase
from ansible.utils.display import Display
@@ -15,7 +14,7 @@ from ansible_sign.checksum import (
InvalidChecksumLine,
)
from ansible_sign.checksum.differ import DistlibManifestChecksumFileExistenceDiffer
-from ansible_sign.signing import *
+from ansible_sign.signing import GPGVerifier
display = Display()
diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py
index 964d13fbf8..a259f40b4e 100644
--- a/awx/settings/defaults.py
+++ b/awx/settings/defaults.py
@@ -360,7 +360,7 @@ REST_FRAMEWORK = {
# For swagger schema generation
# see https://github.com/encode/django-rest-framework/pull/6532
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema',
- #'URL_FORMAT_OVERRIDE': None,
+ # 'URL_FORMAT_OVERRIDE': None,
}
AUTHENTICATION_BACKENDS = (
diff --git a/awx/settings/production.py b/awx/settings/production.py
index d4a40ef5d4..3dce95deb0 100644
--- a/awx/settings/production.py
+++ b/awx/settings/production.py
@@ -101,5 +101,5 @@ except IOError:
# The below runs AFTER all of the custom settings are imported.
DATABASES.setdefault('default', dict()).setdefault('OPTIONS', dict()).setdefault(
- 'application_name', f'{CLUSTER_HOST_ID}-{os.getpid()}-{" ".join(sys.argv)}'[:63]
+ 'application_name', f'{CLUSTER_HOST_ID}-{os.getpid()}-{" ".join(sys.argv)}'[:63] # NOQA
) # noqa
diff --git a/awx/sso/conf.py b/awx/sso/conf.py
index 62d6f47c3a..a835399a3d 100644
--- a/awx/sso/conf.py
+++ b/awx/sso/conf.py
@@ -53,7 +53,7 @@ SOCIAL_AUTH_ORGANIZATION_MAP_HELP_TEXT = _(
'''\
Mapping to organization admins/users from social auth accounts. This setting
controls which users are placed into which organizations based on their
-username and email address. Configuration details are available in the
+username and email address. Configuration details are available in the
documentation.\
'''
)
diff --git a/awx/sso/migrations/0003_convert_saml_string_to_list.py b/awx/sso/migrations/0003_convert_saml_string_to_list.py
index 34a1bbb08e..bacc25e3c0 100644
--- a/awx/sso/migrations/0003_convert_saml_string_to_list.py
+++ b/awx/sso/migrations/0003_convert_saml_string_to_list.py
@@ -6,7 +6,7 @@ _values_to_change = ['is_superuser_value', 'is_superuser_role', 'is_system_audit
def _get_setting():
with connection.cursor() as cursor:
- cursor.execute(f'SELECT value FROM conf_setting WHERE key= %s', ['SOCIAL_AUTH_SAML_USER_FLAGS_BY_ATTR'])
+ cursor.execute('SELECT value FROM conf_setting WHERE key= %s', ['SOCIAL_AUTH_SAML_USER_FLAGS_BY_ATTR'])
row = cursor.fetchone()
if row == None:
return {}
@@ -24,7 +24,7 @@ def _get_setting():
def _set_setting(value):
with connection.cursor() as cursor:
- cursor.execute(f'UPDATE conf_setting SET value = %s WHERE key = %s', [json.dumps(value), 'SOCIAL_AUTH_SAML_USER_FLAGS_BY_ATTR'])
+ cursor.execute('UPDATE conf_setting SET value = %s WHERE key = %s', [json.dumps(value), 'SOCIAL_AUTH_SAML_USER_FLAGS_BY_ATTR'])
def forwards(app, schema_editor):
diff --git a/awx/sso/tests/functional/test_pipeline.py b/awx/sso/tests/functional/test_pipeline.py
index 0d60528793..6bf034b68a 100644
--- a/awx/sso/tests/functional/test_pipeline.py
+++ b/awx/sso/tests/functional/test_pipeline.py
@@ -163,9 +163,9 @@ class TestSAMLAttr:
'PersonImmutableID': [],
},
},
- #'social': <UserSocialAuth: cmeyers@redhat.com>,
+ # 'social': <UserSocialAuth: cmeyers@redhat.com>,
'social': None,
- #'strategy': <awx.sso.strategies.django_strategy.AWXDjangoStrategy object at 0x8523a10>,
+ # 'strategy': <awx.sso.strategies.django_strategy.AWXDjangoStrategy object at 0x8523a10>,
'strategy': None,
'new_association': False,
}
diff --git a/awx_collection/plugins/modules/project.py b/awx_collection/plugins/modules/project.py
index 11f40519b0..4a7c7a4ffd 100644
--- a/awx_collection/plugins/modules/project.py
+++ b/awx_collection/plugins/modules/project.py
@@ -172,7 +172,7 @@ options:
signature_validation_credential:
description:
- Name of the credential to use for signature validation.
- - If signature validation credential is provided, signature validation will be enabled.
+ - If signature validation credential is provided, signature validation will be enabled.
type: str
extends_documentation_fragment: awx.awx.auth
diff --git a/awx_collection/plugins/modules/workflow_job_template.py b/awx_collection/plugins/modules/workflow_job_template.py
index 93eb451503..b7b3c2db74 100644
--- a/awx_collection/plugins/modules/workflow_job_template.py
+++ b/awx_collection/plugins/modules/workflow_job_template.py
@@ -514,7 +514,7 @@ def create_workflow_nodes(module, response, workflow_nodes, workflow_id):
# Lookup Job Template ID
if workflow_node['unified_job_template']['name']:
if workflow_node['unified_job_template']['type'] is None:
- module.fail_json(msg='Could not find unified job template type in workflow_nodes {1}'.format(workflow_node))
+ module.fail_json(msg='Could not find unified job template type in workflow_nodes {0}'.format(workflow_node))
search_fields['type'] = workflow_node['unified_job_template']['type']
if workflow_node['unified_job_template']['type'] == 'inventory_source':
if 'inventory' in workflow_node['unified_job_template']:
diff --git a/tox.ini b/tox.ini
index 4991b0aa9f..4302507621 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,5 +16,5 @@ commands =
yamllint -s .
[flake8]
-select = F401,F402,F821,F823,F841,F811
+select = F401,F402,F821,F823,F841,F811,E265,E266,F541,W605,E722,F822,F523,W291,F405
exclude = awx/ui/node_modules,awx/ui/node_modules,env,awx_collection_build