ansible: flake8 fixes.
This commit is contained in:
parent
df8fe59eda
commit
e35694acd5
|
@ -31,7 +31,6 @@ import logging
|
|||
import os
|
||||
import shlex
|
||||
import stat
|
||||
import sys
|
||||
import time
|
||||
|
||||
import jinja2.runtime
|
||||
|
@ -58,6 +57,7 @@ def _connect_local(spec):
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
def wrap_or_none(klass, value):
|
||||
if value is not None:
|
||||
return klass(value)
|
||||
|
@ -393,7 +393,7 @@ class Connection(ansible.plugins.connection.ConnectionBase):
|
|||
raise ansible.errors.AnsibleConnectionFailure(
|
||||
self.unknown_via_msg % (
|
||||
self.mitogen_via,
|
||||
config['inventory_name'],
|
||||
inventory_name,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ import logging
|
|||
import os
|
||||
import pwd
|
||||
import shutil
|
||||
import tempfile
|
||||
import traceback
|
||||
|
||||
from ansible.module_utils._text import to_bytes
|
||||
|
@ -43,11 +42,6 @@ import ansible.constants
|
|||
import ansible.plugins
|
||||
import ansible.plugins.action
|
||||
|
||||
try:
|
||||
from ansible.plugins.loader import module_loader
|
||||
except ImportError: # Ansible<2.4
|
||||
from ansible.plugins import module_loader
|
||||
|
||||
import mitogen.core
|
||||
import mitogen.select
|
||||
import mitogen.utils
|
||||
|
|
|
@ -85,7 +85,7 @@ def find(name, path=(), parent=None):
|
|||
head, _, tail = name.partition('.')
|
||||
try:
|
||||
tup = imp.find_module(head, list(path))
|
||||
except ImportError as e:
|
||||
except ImportError:
|
||||
return parent
|
||||
|
||||
fp, modpath, (suffix, mode, kind) = tup
|
||||
|
|
|
@ -52,9 +52,7 @@ except ImportError: # Ansible <2.4
|
|||
from ansible.plugins import module_utils_loader
|
||||
|
||||
import mitogen
|
||||
import mitogen.service
|
||||
import ansible_mitogen.target
|
||||
import ansible_mitogen.services
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
|
|
@ -136,7 +136,7 @@ class MuxProcess(object):
|
|||
"""
|
||||
Construct a Router, Broker, and mitogen.unix listener
|
||||
"""
|
||||
self.router = mitogen.master.Router(max_message_size=4096*1048576)
|
||||
self.router = mitogen.master.Router(max_message_size=4096 * 1048576)
|
||||
self.router.responder.whitelist_prefix('ansible')
|
||||
self.router.responder.whitelist_prefix('ansible_mitogen')
|
||||
mitogen.core.listen(self.router.broker, 'shutdown', self.on_broker_shutdown)
|
||||
|
|
|
@ -42,7 +42,6 @@ import imp
|
|||
import json
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
import types
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
from __future__ import absolute_import
|
||||
import os
|
||||
|
||||
import ansible.errors
|
||||
import ansible_mitogen.mixins
|
||||
import ansible_mitogen.process
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ for file transfer, module execution and sundry bits like changing file modes.
|
|||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
import cStringIO
|
||||
import errno
|
||||
import grp
|
||||
import json
|
||||
|
@ -44,7 +43,6 @@ import re
|
|||
import stat
|
||||
import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
import traceback
|
||||
|
||||
import ansible.module_utils.json_utils
|
||||
|
|
|
@ -34,6 +34,7 @@ import pwd
|
|||
import stat
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
import mitogen.core
|
||||
import mitogen.select
|
||||
|
|
Loading…
Reference in New Issue