forked from ungleich-public/cdist
Some pylint cleaning.
This commit is contained in:
parent
722389f838
commit
f368539447
10 changed files with 8 additions and 23 deletions
|
@ -20,8 +20,6 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import sys
|
|
||||||
|
|
||||||
import cdist
|
import cdist
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
|
@ -27,7 +27,6 @@ import sys
|
||||||
import time
|
import time
|
||||||
import itertools
|
import itertools
|
||||||
import tempfile
|
import tempfile
|
||||||
import socket
|
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
from cdist.mputil import mp_pool_run, mp_sig_handler
|
from cdist.mputil import mp_pool_run, mp_sig_handler
|
||||||
import atexit
|
import atexit
|
||||||
|
@ -49,14 +48,17 @@ class Config(object):
|
||||||
"""Cdist main class to hold arbitrary data"""
|
"""Cdist main class to hold arbitrary data"""
|
||||||
|
|
||||||
def __init__(self, local, remote, dry_run=False, jobs=None,
|
def __init__(self, local, remote, dry_run=False, jobs=None,
|
||||||
cleanup_cmds=[]):
|
cleanup_cmds=None):
|
||||||
|
|
||||||
self.local = local
|
self.local = local
|
||||||
self.remote = remote
|
self.remote = remote
|
||||||
self._open_logger()
|
self._open_logger()
|
||||||
self.dry_run = dry_run
|
self.dry_run = dry_run
|
||||||
self.jobs = jobs
|
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.explorer = core.Explorer(self.local.target_host, self.local,
|
||||||
self.remote, jobs=self.jobs)
|
self.remote, jobs=self.jobs)
|
||||||
|
@ -111,7 +113,6 @@ class Config(object):
|
||||||
if not (args.hostfile or args.host):
|
if not (args.hostfile or args.host):
|
||||||
args.hostfile = '-'
|
args.hostfile = '-'
|
||||||
|
|
||||||
initial_manifest_tempfile = None
|
|
||||||
if args.manifest == '-':
|
if args.manifest == '-':
|
||||||
# read initial manifest from stdin
|
# read initial manifest from stdin
|
||||||
try:
|
try:
|
||||||
|
@ -623,8 +624,6 @@ class Config(object):
|
||||||
raise cdist.Error(("Attempting to run an already finished "
|
raise cdist.Error(("Attempting to run an already finished "
|
||||||
"object: %s"), cdist_object)
|
"object: %s"), cdist_object)
|
||||||
|
|
||||||
cdist_type = cdist_object.cdist_type
|
|
||||||
|
|
||||||
# Generate
|
# Generate
|
||||||
self.log.debug("Generating code for %s" % (cdist_object.name))
|
self.log.debug("Generating code for %s" % (cdist_object.name))
|
||||||
cdist_object.code_local = self.code.run_gencode_local(cdist_object)
|
cdist_object.code_local = self.code.run_gencode_local(cdist_object)
|
||||||
|
|
|
@ -23,8 +23,6 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import cdist
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
common:
|
common:
|
||||||
|
|
|
@ -98,7 +98,7 @@ class Emulator(object):
|
||||||
self.init_object()
|
self.init_object()
|
||||||
|
|
||||||
# locking for parallel execution
|
# locking for parallel execution
|
||||||
with flock.Flock(self.flock_path) as lock:
|
with flock.Flock(self.flock_path):
|
||||||
self.setup_object()
|
self.setup_object()
|
||||||
self.save_stdin()
|
self.save_stdin()
|
||||||
self.record_requirements()
|
self.record_requirements()
|
||||||
|
@ -112,7 +112,7 @@ class Emulator(object):
|
||||||
if '__cdist_loglevel' in self.env:
|
if '__cdist_loglevel' in self.env:
|
||||||
try:
|
try:
|
||||||
level = int(self.env['__cdist_loglevel'])
|
level = int(self.env['__cdist_loglevel'])
|
||||||
except:
|
except ValueError:
|
||||||
level = logging.WARNING
|
level = logging.WARNING
|
||||||
else:
|
else:
|
||||||
level = logging.WARNING
|
level = logging.WARNING
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
import io
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
@ -348,7 +347,6 @@ class Local(object):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for entry in os.listdir(current_dir):
|
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,
|
src = os.path.abspath(os.path.join(conf_dir,
|
||||||
sub_dir,
|
sub_dir,
|
||||||
entry))
|
entry))
|
||||||
|
|
|
@ -20,9 +20,7 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
import io
|
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import glob
|
import glob
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
|
||||||
from tempfile import TemporaryFile
|
from tempfile import TemporaryFile
|
||||||
|
|
||||||
import cdist
|
import cdist
|
||||||
|
|
|
@ -24,8 +24,6 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
import cdist
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import subprocess
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
# initialise cdist
|
# initialise cdist
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
import collections
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,8 +33,6 @@ def commandline():
|
||||||
import cdist.install
|
import cdist.install
|
||||||
import cdist.shell
|
import cdist.shell
|
||||||
import cdist.inventory
|
import cdist.inventory
|
||||||
import shutil
|
|
||||||
import os
|
|
||||||
|
|
||||||
parser = cdist.argparse.get_parsers()
|
parser = cdist.argparse.get_parsers()
|
||||||
args = parser['main'].parse_args(sys.argv[1:])
|
args = parser['main'].parse_args(sys.argv[1:])
|
||||||
|
@ -64,6 +61,7 @@ def commandline():
|
||||||
cdist.argparse.check_beta(vars(args))
|
cdist.argparse.check_beta(vars(args))
|
||||||
args.func(args)
|
args.func(args)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue