Merge pull request #6077 from Spredzy/fix_linting

awx-api-lint: Fix setup.cfg syntax for linter test

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2020-02-26 13:10:21 +00:00
committed by GitHub
4 changed files with 11 additions and 9 deletions

View File

@@ -182,7 +182,8 @@ class CredentialType(HasCreate, base.Base):
response = self.connection.post(urljoin(str(self.url), 'test/'), data) response = self.connection.post(urljoin(str(self.url), 'test/'), data)
exception = exception_from_status_code(response.status_code) exception = exception_from_status_code(response.status_code)
exc_str = "%s (%s) received" % ( exc_str = "%s (%s) received" % (
http.responses[response.status_code], response.status_code) http.responses[response.status_code], response.status_code
)
if exception: if exception:
raise exception(exc_str, response.json()) raise exception(exc_str, response.json())
elif response.status_code == http.FORBIDDEN: elif response.status_code == http.FORBIDDEN:
@@ -328,7 +329,8 @@ class Credential(HasCopy, HasCreate, base.Base):
response = self.connection.post(urljoin(str(self.url), 'test/'), data) response = self.connection.post(urljoin(str(self.url), 'test/'), data)
exception = exception_from_status_code(response.status_code) exception = exception_from_status_code(response.status_code)
exc_str = "%s (%s) received" % ( exc_str = "%s (%s) received" % (
http.responses[response.status_code], response.status_code) http.responses[response.status_code], response.status_code
)
if exception: if exception:
raise exception(exc_str, response.json()) raise exception(exc_str, response.json())
elif response.status_code == http.FORBIDDEN: elif response.status_code == http.FORBIDDEN:

View File

@@ -1,5 +1,4 @@
from argparse import ArgumentParser from argparse import ArgumentParser
import traceback
import logging import logging
import pdb # noqa import pdb # noqa
import sys import sys
@@ -92,8 +91,8 @@ def main():
exc = e exc = e
raise raise
except Exception as e: except Exception as e:
exc = e exc = e # noqa
rc = 1 rc = 1 # noqa
raise raise

View File

@@ -25,5 +25,5 @@ deps =
flake8 flake8
yamllint yamllint
commands = commands =
- flake8 flake8
- yamllint -s . yamllint -s .

View File

@@ -33,7 +33,6 @@ import subprocess
import sys import sys
from io import StringIO from io import StringIO
from time import time from time import time
from random import randint
from uuid import uuid4 from uuid import uuid4
import psycopg2 import psycopg2
@@ -200,7 +199,9 @@ def generate_events(events, job):
cursor.execute("SELECT indexname, indexdef FROM pg_indexes WHERE tablename='main_jobevent' AND indexname != 'main_jobevent_pkey';") cursor.execute("SELECT indexname, indexdef FROM pg_indexes WHERE tablename='main_jobevent' AND indexname != 'main_jobevent_pkey';")
indexes = cursor.fetchall() indexes = cursor.fetchall()
cursor.execute("SELECT conname, contype, pg_catalog.pg_get_constraintdef(r.oid, true) as condef FROM pg_catalog.pg_constraint r WHERE r.conrelid = 'main_jobevent'::regclass AND conname != 'main_jobevent_pkey';") cursor.execute(
"SELECT conname, contype, pg_catalog.pg_get_constraintdef(r.oid, true) as condef FROM pg_catalog.pg_constraint r WHERE r.conrelid = 'main_jobevent'::regclass AND conname != 'main_jobevent_pkey';" # noqa
)
constraints = cursor.fetchall() constraints = cursor.fetchall()
# drop all indexes for speed # drop all indexes for speed