Commit 63828205 authored by Duncan Macleod's avatar Duncan Macleod
Browse files

fixed flake8 issues

parent 5074defe
......@@ -16,12 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import os.path
import pathlib
import re
import shutil
import subprocess
import tempfile
from distutils.spawn import find_executable
......
......@@ -68,7 +68,8 @@ DEFAULT_TARGET = "sandox"
def parse_options():
# define option parser
parser = argparse.ArgumentParser(description='Build RPMs using Koji')
parser.add_argument('-V', '--version', action='version', version=__version__,
parser.add_argument('-V', '--version', action='version',
version=__version__,
help='show version number and exit')
parser.add_argument('-v', '--verbose', action='count', default=2,
help='show verbose output, give once for INFO, '
......@@ -194,6 +195,7 @@ def main():
logger.info('-- Complete -----')
#
# main program entry point
#
......
......@@ -19,7 +19,6 @@
"""Test suite for gwkoji.build
"""
import subprocess
from unittest import mock
from .. import build as gwkoji_build
......
......@@ -20,7 +20,7 @@ import logging
import pathlib
import sys
from functools import wraps
from subprocess import (check_call, check_output, call, STDOUT, DEVNULL)
from subprocess import (check_call, check_output, call, DEVNULL)
def _logged_call(func):
......@@ -33,11 +33,11 @@ def _logged_call(func):
# set default streams based on logging level
if logger.getEffectiveLevel() > logging.INFO:
kwargs.setdefault('stderr', subprocess.DEVNULL)
kwargs.setdefault('stderr', DEVNULL)
if func != check_output:
kwargs.setdefault('stdout', subprocess.DEVNULL)
kwargs.setdefault('stdout', DEVNULL)
elif func != check_output:
kwargs.setdefault('stdout', sys.stderr)
kwargs.setdefault('stdout', sys.stderr)
# log the command
logger.log(loglevel, '$ {0}'.format(' '.join(cmd)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment