From 15de3e1687c5ba1619c6a2f1c1d62ff7d498a73c Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Thu, 12 Oct 2017 14:14:20 +0300 Subject: [PATCH] pylint fix: remove unused imports --- setup.py | 1 - src/bin/image-minimizer | 1 - src/pylorax/__init__.py | 2 +- src/pylorax/api/server.py | 2 +- src/pylorax/creator.py | 12 ++++-------- src/pylorax/installer.py | 10 +++++----- src/pylorax/sysutils.py | 1 - src/pylorax/treebuilder.py | 2 +- src/pylorax/yumhelper.py | 2 +- src/sbin/lorax-composer | 2 -- 10 files changed, 13 insertions(+), 22 deletions(-) diff --git a/setup.py b/setup.py index c0e03fa8..e3f71fb1 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/python from distutils.core import setup -from glob import glob import os import sys diff --git a/src/bin/image-minimizer b/src/bin/image-minimizer index e6135564..f428d2e2 100755 --- a/src/bin/image-minimizer +++ b/src/bin/image-minimizer @@ -19,7 +19,6 @@ import glob import optparse import os -import shutil import sys import rpm diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index d6a115c7..ea3f8fa6 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -33,7 +33,7 @@ import locale from subprocess import CalledProcessError import selinux -from base import BaseLoraxClass, DataHolder +from .base import BaseLoraxClass, DataHolder import output import yum diff --git a/src/pylorax/api/server.py b/src/pylorax/api/server.py index 5e1d2a8a..05be40ca 100644 --- a/src/pylorax/api/server.py +++ b/src/pylorax/api/server.py @@ -15,7 +15,7 @@ # along with this program. If not, see . # -from flask import Flask, jsonify +from flask import Flask from pylorax.api import crossdomain from pylorax.api.v0 import v0_api diff --git a/src/pylorax/creator.py b/src/pylorax/creator.py index bca52c75..d2c3f86c 100644 --- a/src/pylorax/creator.py +++ b/src/pylorax/creator.py @@ -18,13 +18,10 @@ import logging log = logging.getLogger("pylorax") import os -import sys import tempfile import subprocess -import threading import shutil import hashlib -import re import glob # Use Mako templates for appliance builder descriptions @@ -32,15 +29,14 @@ from mako.template import Template from mako.exceptions import text_error_template # Use the Lorax treebuilder branch for iso creation -from pylorax import ArchData, vernum +from pylorax import ArchData from pylorax.base import DataHolder -from pylorax.treebuilder import TreeBuilder, RuntimeBuilder, udev_escape +from pylorax.treebuilder import TreeBuilder, RuntimeBuilder from pylorax.treebuilder import findkernels from pylorax.sysutils import joinpaths, remove -from pylorax.imgutils import mount, umount, Mount +from pylorax.imgutils import mount, umount from pylorax.imgutils import mksquashfs, mkrootfsimg -from pylorax.imgutils import copytree -from pylorax.executils import execWithRedirect, execWithCapture, runcmd +from pylorax.executils import execWithRedirect, runcmd from pylorax.installer import InstallError, novirt_install, virt_install RUNTIME = "images/install.img" diff --git a/src/pylorax/installer.py b/src/pylorax/installer.py index 0d6914b6..90a4a9c7 100644 --- a/src/pylorax/installer.py +++ b/src/pylorax/installer.py @@ -25,13 +25,13 @@ import tempfile from time import sleep import uuid -from pylorax.executils import execWithRedirect, execWithCapture, runcmd -from pylorax.imgutils import get_loop_name, dm_detach, mount, umount, Mount +from pylorax.executils import execWithRedirect, execWithCapture +from pylorax.imgutils import get_loop_name, dm_detach, mount, umount from pylorax.imgutils import PartitionMount, mksparse, mkext4img, loop_detach -from pylorax.imgutils import mksquashfs, mktar, mkrootfsimg, mkdiskfsimage, mkqcow2 +from pylorax.imgutils import mktar, mkdiskfsimage, mkqcow2 from pylorax.logmonitor import LogMonitor -from pylorax.sysutils import joinpaths, remove -from pylorax.treebuilder import TreeBuilder, RuntimeBuilder, udev_escape +from pylorax.sysutils import joinpaths +from pylorax.treebuilder import udev_escape ROOT_PATH = "/mnt/sysimage/" diff --git a/src/pylorax/sysutils.py b/src/pylorax/sysutils.py index 8743b9a4..601f9ba6 100644 --- a/src/pylorax/sysutils.py +++ b/src/pylorax/sysutils.py @@ -30,7 +30,6 @@ import pwd import grp import glob import shutil -import subprocess from pylorax.executils import runcmd diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index 73e02e65..495e35cf 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -21,7 +21,7 @@ import logging logger = logging.getLogger("pylorax.treebuilder") import os, re -from os.path import basename, isdir +from os.path import basename from sysutils import joinpaths, remove from shutil import copytree, copy2 diff --git a/src/pylorax/yumhelper.py b/src/pylorax/yumhelper.py index 6732c35f..a362bd29 100644 --- a/src/pylorax/yumhelper.py +++ b/src/pylorax/yumhelper.py @@ -21,7 +21,7 @@ import logging logger = logging.getLogger("pylorax.yumhelper") -import sys, os, re +import re import yum, yum.callbacks, yum.rpmtrans import output diff --git a/src/sbin/lorax-composer b/src/sbin/lorax-composer index 87c438c3..222c76f7 100755 --- a/src/sbin/lorax-composer +++ b/src/sbin/lorax-composer @@ -24,9 +24,7 @@ pylorax_log = logging.getLogger("pylorax") import argparse import os -import shutil import sys -import tempfile from gevent.wsgi import WSGIServer from pylorax import vernum