Skip to content

Commit

Permalink
Merge pull request #11544 from AlanCoding/another_rule
Browse files Browse the repository at this point in the history
Respect linter rule F811 about trivial re-definition
  • Loading branch information
amolgautam25 authored Jan 14, 2022
2 parents bff49f2 + 72cd73c commit 6dda5f4
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 13 deletions.
3 changes: 1 addition & 2 deletions awx/main/models/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,7 @@ def _update_host_summary_from_stats(self, hostnames):
return
job = self.job

from awx.main.models import Host, JobHostSummary # circular import
from awx.main.models import Host, JobHostSummary, HostMetric
from awx.main.models import Host, JobHostSummary, HostMetric # circular import

all_hosts = Host.objects.filter(pk__in=self.host_map.values()).only('id', 'name')
existing_host_ids = set(h.id for h in all_hosts)
Expand Down
2 changes: 0 additions & 2 deletions awx/main/tasks/jobs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Python
from asyncio.log import logger
from collections import deque, OrderedDict
from distutils.dir_util import copy_tree
import errno
Expand Down Expand Up @@ -39,7 +38,6 @@
from awx.main.dispatch.publish import task
from awx.main.dispatch import get_local_queuename
from awx.main.constants import PRIVILEGE_ESCALATION_METHODS, STANDARD_INVENTORY_UPDATE_ENV, MINIMAL_EVENTS, JOB_FOLDER_PREFIX
from awx.main.utils.safe_yaml import safe_dump
from awx.main.redact import UriCleaner
from awx.main.models import (
Instance,
Expand Down
1 change: 0 additions & 1 deletion awx/main/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import subprocess
import re
import stat
import subprocess
import urllib.parse
import threading
import contextlib
Expand Down
6 changes: 1 addition & 5 deletions awx_collection/plugins/lookup/schedule_rrule.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
from ansible.plugins.lookup import LookupBase
from ansible.errors import AnsibleError
from datetime import datetime
from dateutil import rrule

try:
import pytz
Expand Down Expand Up @@ -132,10 +131,7 @@ class LookupModule(LookupBase):
# plugin constructor
def __init__(self, *args, **kwargs):
if LIBRARY_IMPORT_ERROR:
raise_from(
AnsibleError('{0}'.format(LIBRARY_IMPORT_ERROR)),
LIBRARY_IMPORT_ERROR
)
raise_from(AnsibleError('{0}'.format(LIBRARY_IMPORT_ERROR)), LIBRARY_IMPORT_ERROR)
super().__init__(*args, **kwargs)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion awx_collection/test/awx/test_credential_input_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def source_cred_aim_alt(aim_cred_type):


@pytest.mark.django_db
def test_aim_credential_source(run_module, admin_user, organization, source_cred_aim, source_cred_aim_alt, silence_deprecation):
def test_aim_credential_source_change_source(run_module, admin_user, organization, source_cred_aim, source_cred_aim_alt, silence_deprecation):
ct = CredentialType.defaults['ssh']()
ct.save()
tgt_cred = Credential.objects.create(name='Test Machine Credential', organization=organization, credential_type=ct, inputs={'username': 'bob'})
Expand Down
2 changes: 1 addition & 1 deletion awx_collection/test/awx/test_workflow_job_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_survey_spec_only_changed(run_module, admin_user, organization, survey_s


@pytest.mark.django_db
def test_survey_spec_only_changed(run_module, admin_user, organization, survey_spec):
def test_survey_spec_missing_field(run_module, admin_user, organization, survey_spec):
wfjt = WorkflowJobTemplate.objects.create(organization=organization, name='foo-workflow', survey_enabled=True, survey_spec=survey_spec)
result = run_module('workflow_job_template', {'name': 'foo-workflow', 'organization': organization.name, 'state': 'present'}, admin_user)
assert not result.get('failed', False), result.get('msg', result)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ commands =
yamllint -s .

[flake8]
select = F401,F402,F821,F823,F841
select = F401,F402,F821,F823,F841,F811
exclude = awx/ui/node_modules,awx/ui/node_modules,env,awx_collection_build

0 comments on commit 6dda5f4

Please sign in to comment.