From b69f7c11e41e0094d49b2fe2f60a8bb8fb6ee019 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Mon, 1 Oct 2018 09:49:58 +0100 Subject: Ignore new PEP8 warning W504 Update for some occurrences of W604 but exclude files where this is unrealistic. Ignore W504 as this currently conflicts with black. Signed-off-by: Neil Williams --- ci-run | 2 +- lava_common/constants.py | 16 ++++++++-------- lava_dispatcher/actions/deploy/overlay.py | 8 ++++---- lava_dispatcher/protocols/multinode.py | 2 +- lava_server/management/commands/jobs.py | 2 +- lava_server/settings/config_file.py | 2 +- share/release-queue.py | 6 +++--- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ci-run b/ci-run index 398d63d62..5d9adbe2c 100755 --- a/ci-run +++ b/ci-run @@ -64,7 +64,7 @@ then exit 0 fi -pep8 --ignore E501,E203,W503 . +pep8 --ignore E501,E203,W503,W504 --exclude migrations,lava_scheduler_app/tests/test_api.py . if [ -n "${PEP8}" ] then diff --git a/lava_common/constants.py b/lava_common/constants.py index 25a23280f..52fb1d46c 100644 --- a/lava_common/constants.py +++ b/lava_common/constants.py @@ -86,17 +86,17 @@ BOOTLOADER_DEFAULT_CMD_TIMEOUT = 90 # kernel boot monitoring # Some successful kernel builds end the boot with this string -KERNEL_FREE_UNUSED_MSG = 'Freeing unused kernel memory' +KERNEL_FREE_UNUSED_MSG = r'Freeing unused kernel memory' # Some successful kernel builds end the boot with this string -KERNEL_FREE_INIT_MSG = 'Freeing init memory' +KERNEL_FREE_INIT_MSG = r'Freeing init memory' # exception -KERNEL_EXCEPTION_MSG = '-+\[ cut here \]-+\s+(.*\s+-+\[ end trace (\w*) \]-+)' +KERNEL_EXCEPTION_MSG = r'-+\[ cut here \]-+\s+(.*\s+-+\[ end trace (\w*) \]-+)' # stack trace -KERNEL_TRACE_MSG = 'Stack:\s+(.*\s+-+\[ end trace (\w*) \]-+)' +KERNEL_TRACE_MSG = r'Stack:\s+(.*\s+-+\[ end trace (\w*) \]-+)' # unhandled fault -KERNEL_FAULT_MSG = '(Unhandled fault.*)\r\n' +KERNEL_FAULT_MSG = r'(Unhandled fault.*)\r\n' # panic -KERNEL_PANIC_MSG = "Kernel panic - (.*) end Kernel panic" +KERNEL_PANIC_MSG = r"Kernel panic - (.*) end Kernel panic" # Login incorrect message LOGIN_INCORRECT_MSG = 'Login incorrect' @@ -113,10 +113,10 @@ DEFAULT_V1_PATTERN = "(?P.*-*)\\s+:\\s+(?P(PASS|pass|FAIL| DEFAULT_V1_FIXUP = {'PASS': 'pass', 'FAIL': 'fail', 'SKIP': 'skip', 'UNKNOWN': 'unknown'} # List of DD output prompts for notifying completion of secondary deployment -DD_PROMPTS = ['[0-9]+\+[0-9]+ records out', '[0-9]+ bytes \(.*\) copied'] +DD_PROMPTS = [r'[0-9]+\+[0-9]+ records out', r'[0-9]+ bytes \(.*\) copied'] # fallback UEFI menu label class -DEFAULT_UEFI_LABEL_CLASS = 'a-zA-Z0-9\s\:' +DEFAULT_UEFI_LABEL_CLASS = r'a-zA-Z0-9\s\:' # Set a default newline seperator for pexpect, override as necessary LINE_SEPARATOR = '\n' diff --git a/lava_dispatcher/actions/deploy/overlay.py b/lava_dispatcher/actions/deploy/overlay.py index 11d428132..ac6fe5452 100644 --- a/lava_dispatcher/actions/deploy/overlay.py +++ b/lava_dispatcher/actions/deploy/overlay.py @@ -370,11 +370,11 @@ class VlandOverlayAction(OverlayAction): def run(self, connection, max_end_time): """ Writes out file contents from lists, across multiple lines - VAR="VAL1\n\ - VAL2\n\ + VAR="VAL1\n + VAL2\n " - The \n and \ are used to avoid unwanted whitespace, so are escaped. - \n becomes \\n, \ becomes \\, which itself then needs \n to output: + The newline and escape characters are used to avoid unwanted whitespace. + \n becomes \\n, a single escape gets expanded and itself then needs \n to output: VAL1 VAL2 """ diff --git a/lava_dispatcher/protocols/multinode.py b/lava_dispatcher/protocols/multinode.py index 878ad7c72..2c828a78a 100644 --- a/lava_dispatcher/protocols/multinode.py +++ b/lava_dispatcher/protocols/multinode.py @@ -403,7 +403,7 @@ class MultinodeProtocol(Protocol): # pylint: disable=too-many-instance-attribut try: return self._api_select(json.dumps(args[0])) except (ValueError, TypeError) as exc: - msg = re.sub('\s+', ' ', ''.join(traceback.format_exc().split('\n'))) + msg = re.sub(r'\s+', ' ', ''.join(traceback.format_exc().split('\n'))) logger = logging.getLogger("dispatcher") logger.exception(msg) raise JobError("Invalid call to %s %s" % (self.name, exc)) diff --git a/lava_server/management/commands/jobs.py b/lava_server/management/commands/jobs.py index 3656c4e9d..ec86c93a2 100644 --- a/lava_server/management/commands/jobs.py +++ b/lava_server/management/commands/jobs.py @@ -109,7 +109,7 @@ class Command(BaseCommand): jobs = TestJob.objects.all().order_by('id') if older_than is not None: - pattern = re.compile("^(?P