Update for Python 3.8 pylint alerts

This commit is contained in:
2Shirt 2019-12-02 17:55:05 -07:00
parent 7796189d14
commit c520b5a865
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
3 changed files with 9 additions and 2 deletions

View file

@ -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): def run_program(cmd, check=True, pipe=True, shell=False, **kwargs):
# pylint: disable=subprocess-run-check
"""Run program and return a subprocess.CompletedProcess object.""" """Run program and return a subprocess.CompletedProcess object."""
LOG.debug( LOG.debug(
'cmd: %s, check: %s, pipe: %s, shell: %s', 'cmd: %s, check: %s, pipe: %s, shell: %s',

View file

@ -497,6 +497,7 @@ def disk_attribute_check(state, test_objects):
"""Disk attribute check.""" """Disk attribute check."""
LOG.info('Disk Attribute Check') LOG.info('Disk Attribute Check')
#TODO: at #TODO: at
LOG.debug('%s, %s', state, test_objects)
std.print_warning('TODO: at') std.print_warning('TODO: at')
std.pause() std.pause()
@ -505,6 +506,7 @@ def disk_io_benchmark(state, test_objects):
"""Disk I/O benchmark using dd.""" """Disk I/O benchmark using dd."""
LOG.info('Disk I/O Benchmark (dd)') LOG.info('Disk I/O Benchmark (dd)')
#TODO: io #TODO: io
LOG.debug('%s, %s', state, test_objects)
std.print_warning('TODO: io') std.print_warning('TODO: io')
std.pause() std.pause()
@ -513,6 +515,7 @@ def disk_self_test(state, test_objects):
"""Disk self-test if available.""" """Disk self-test if available."""
LOG.info('Disk Self-Test') LOG.info('Disk Self-Test')
#TODO: st #TODO: st
LOG.debug('%s, %s', state, test_objects)
std.print_warning('TODO: st') std.print_warning('TODO: st')
std.pause() std.pause()
@ -521,6 +524,7 @@ def disk_surface_scan(state, test_objects):
"""Disk surface scan using badblocks.""" """Disk surface scan using badblocks."""
LOG.info('Disk Surface Scan (badblocks)') LOG.info('Disk Surface Scan (badblocks)')
#TODO: bb #TODO: bb
LOG.debug('%s, %s', state, test_objects)
std.print_warning('TODO: bb') std.print_warning('TODO: bb')
std.pause() std.pause()

View file

@ -9,12 +9,16 @@ import os
import pathlib import pathlib
import platform import platform
import re import re
import socket
import subprocess import subprocess
import sys import sys
import time import time
import traceback import traceback
from collections import OrderedDict from collections import OrderedDict
import requests
try: try:
from termios import tcflush, TCIOFLUSH from termios import tcflush, TCIOFLUSH
except ImportError: except ImportError:
@ -716,7 +720,6 @@ def color_string(strings, colors, sep=' '):
def generate_debug_report(): def generate_debug_report():
"""Generate debug report, returns str.""" """Generate debug report, returns str."""
import socket
platform_function_list = ( platform_function_list = (
'architecture', 'architecture',
'machine', 'machine',
@ -971,7 +974,6 @@ def strip_colors(string):
def upload_debug_report(report, compress=True, reason='DEBUG'): def upload_debug_report(report, compress=True, reason='DEBUG'):
"""Upload debug report to CRASH_SERVER as specified in wk.cfg.main.""" """Upload debug report to CRASH_SERVER as specified in wk.cfg.main."""
LOG.info('Uploading debug report to %s', CRASH_SERVER.get('Name', '?')) LOG.info('Uploading debug report to %s', CRASH_SERVER.get('Name', '?'))
import requests
headers = CRASH_SERVER.get('Headers', {'X-Requested-With': 'XMLHttpRequest'}) headers = CRASH_SERVER.get('Headers', {'X-Requested-With': 'XMLHttpRequest'})
if compress: if compress:
headers['Content-Type'] = 'application/octet-stream' headers['Content-Type'] = 'application/octet-stream'