Some pylint cleaning.

This commit is contained in:
Darko Poljak 2017-08-22 10:58:30 +02:00
parent 722389f838
commit f368539447
10 changed files with 8 additions and 23 deletions

View File

@ -20,8 +20,6 @@
#
import logging
import sys
import cdist
log = logging.getLogger(__name__)

View File

@ -27,7 +27,6 @@ import sys
import time
import itertools
import tempfile
import socket
import multiprocessing
from cdist.mputil import mp_pool_run, mp_sig_handler
import atexit
@ -49,14 +48,17 @@ class Config(object):
"""Cdist main class to hold arbitrary data"""
def __init__(self, local, remote, dry_run=False, jobs=None,
cleanup_cmds=[]):
cleanup_cmds=None):
self.local = local
self.remote = remote
self._open_logger()
self.dry_run = dry_run
self.jobs = jobs
self.cleanup_cmds = cleanup_cmds
if cleanup_cmds:
self.cleanup_cmds = cleanup_cmds
else:
self.cleanup_cmds = []
self.explorer = core.Explorer(self.local.target_host, self.local,
self.remote, jobs=self.jobs)
@ -111,7 +113,6 @@ class Config(object):
if not (args.hostfile or args.host):
args.hostfile = '-'
initial_manifest_tempfile = None
if args.manifest == '-':
# read initial manifest from stdin
try:
@ -623,8 +624,6 @@ class Config(object):
raise cdist.Error(("Attempting to run an already finished "
"object: %s"), cdist_object)
cdist_type = cdist_object.cdist_type
# Generate
self.log.debug("Generating code for %s" % (cdist_object.name))
cdist_object.code_local = self.code.run_gencode_local(cdist_object)

View File

@ -23,8 +23,6 @@
import os
import cdist
'''
common:

View File

@ -98,7 +98,7 @@ class Emulator(object):
self.init_object()
# locking for parallel execution
with flock.Flock(self.flock_path) as lock:
with flock.Flock(self.flock_path):
self.setup_object()
self.save_stdin()
self.record_requirements()
@ -112,7 +112,7 @@ class Emulator(object):
if '__cdist_loglevel' in self.env:
try:
level = int(self.env['__cdist_loglevel'])
except:
except ValueError:
level = logging.WARNING
else:
level = logging.WARNING

View File

@ -21,7 +21,6 @@
#
#
import io
import os
import sys
import re
@ -348,7 +347,6 @@ class Local(object):
continue
for entry in os.listdir(current_dir):
rel_entry_path = os.path.join(sub_dir, entry)
src = os.path.abspath(os.path.join(conf_dir,
sub_dir,
entry))

View File

@ -20,9 +20,7 @@
#
#
import io
import os
import sys
import glob
import subprocess
import logging

View File

@ -20,7 +20,6 @@
#
import subprocess
import sys
from tempfile import TemporaryFile
import cdist

View File

@ -24,8 +24,6 @@ import os
import shutil
import tempfile
import cdist
log = logging.getLogger(__name__)

View File

@ -21,7 +21,6 @@
import logging
import os
import subprocess
import tempfile
# initialise cdist

View File

@ -21,7 +21,6 @@
#
#
import collections
import logging
@ -34,8 +33,6 @@ def commandline():
import cdist.install
import cdist.shell
import cdist.inventory
import shutil
import os
parser = cdist.argparse.get_parsers()
args = parser['main'].parse_args(sys.argv[1:])
@ -64,6 +61,7 @@ def commandline():
cdist.argparse.check_beta(vars(args))
args.func(args)
if __name__ == "__main__":
import sys