From c520b5a86565edc2afa2313c587809a682d6972d Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 2 Dec 2019 17:55:05 -0700 Subject: [PATCH] Update for Python 3.8 pylint alerts --- scripts/wk/exe.py | 1 + scripts/wk/hw/diags.py | 4 ++++ scripts/wk/std.py | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/wk/exe.py b/scripts/wk/exe.py index c5c1718b..b1d1927c 100644 --- a/scripts/wk/exe.py +++ b/scripts/wk/exe.py @@ -181,6 +181,7 @@ def popen_program(cmd, minimized=False, pipe=False, shell=False, **kwargs): def run_program(cmd, check=True, pipe=True, shell=False, **kwargs): + # pylint: disable=subprocess-run-check """Run program and return a subprocess.CompletedProcess object.""" LOG.debug( 'cmd: %s, check: %s, pipe: %s, shell: %s', diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index 62669a03..41d784f7 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -497,6 +497,7 @@ def disk_attribute_check(state, test_objects): """Disk attribute check.""" LOG.info('Disk Attribute Check') #TODO: at + LOG.debug('%s, %s', state, test_objects) std.print_warning('TODO: at') std.pause() @@ -505,6 +506,7 @@ def disk_io_benchmark(state, test_objects): """Disk I/O benchmark using dd.""" LOG.info('Disk I/O Benchmark (dd)') #TODO: io + LOG.debug('%s, %s', state, test_objects) std.print_warning('TODO: io') std.pause() @@ -513,6 +515,7 @@ def disk_self_test(state, test_objects): """Disk self-test if available.""" LOG.info('Disk Self-Test') #TODO: st + LOG.debug('%s, %s', state, test_objects) std.print_warning('TODO: st') std.pause() @@ -521,6 +524,7 @@ def disk_surface_scan(state, test_objects): """Disk surface scan using badblocks.""" LOG.info('Disk Surface Scan (badblocks)') #TODO: bb + LOG.debug('%s, %s', state, test_objects) std.print_warning('TODO: bb') std.pause() diff --git a/scripts/wk/std.py b/scripts/wk/std.py index 32a107f6..d0eecde4 100644 --- a/scripts/wk/std.py +++ b/scripts/wk/std.py @@ -9,12 +9,16 @@ import os import pathlib import platform import re +import socket import subprocess import sys import time import traceback from collections import OrderedDict + +import requests + try: from termios import tcflush, TCIOFLUSH except ImportError: @@ -716,7 +720,6 @@ def color_string(strings, colors, sep=' '): def generate_debug_report(): """Generate debug report, returns str.""" - import socket platform_function_list = ( 'architecture', 'machine', @@ -971,7 +974,6 @@ def strip_colors(string): def upload_debug_report(report, compress=True, reason='DEBUG'): """Upload debug report to CRASH_SERVER as specified in wk.cfg.main.""" LOG.info('Uploading debug report to %s', CRASH_SERVER.get('Name', '?')) - import requests headers = CRASH_SERVER.get('Headers', {'X-Requested-With': 'XMLHttpRequest'}) if compress: headers['Content-Type'] = 'application/octet-stream'