diff options
Diffstat (limited to 'ansible_collections/cloud/common/plugins/module_utils')
3 files changed, 14 insertions, 19 deletions
diff --git a/ansible_collections/cloud/common/plugins/module_utils/turbo/common.py b/ansible_collections/cloud/common/plugins/module_utils/turbo/common.py index e5ad19383..ebe9b0c2a 100644 --- a/ansible_collections/cloud/common/plugins/module_utils/turbo/common.py +++ b/ansible_collections/cloud/common/plugins/module_utils/turbo/common.py @@ -25,18 +25,16 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +import json import os +import pickle import socket +import subprocess import sys import time -import subprocess -import pickle from contextlib import contextmanager -import json -from .exceptions import ( - EmbeddedModuleUnexpectedFailure, -) +from .exceptions import EmbeddedModuleUnexpectedFailure class AnsibleTurboSocket: @@ -107,7 +105,7 @@ class AnsibleTurboSocket: return result except json.decoder.JSONDecodeError: raise EmbeddedModuleUnexpectedFailure( - "Cannot decode plugin answer: {0}".format(raw_answer) + f"Cannot decode plugin answer: {raw_answer}" ) def close(self): diff --git a/ansible_collections/cloud/common/plugins/module_utils/turbo/module.py b/ansible_collections/cloud/common/plugins/module_utils/turbo/module.py index c2f9d667e..64b9fba42 100644 --- a/ansible_collections/cloud/common/plugins/module_utils/turbo/module.py +++ b/ansible_collections/cloud/common/plugins/module_utils/turbo/module.py @@ -32,12 +32,10 @@ import sys import tempfile import ansible.module_utils.basic -from .exceptions import ( - EmbeddedModuleSuccess, - EmbeddedModuleFailure, -) import ansible_collections.cloud.common.plugins.module_utils.turbo.common +from .exceptions import EmbeddedModuleFailure, EmbeddedModuleSuccess + if False: # pylint: disable=using-constant-test from .server import please_include_me diff --git a/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py b/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py index 04ddf67f3..2769580b4 100644 --- a/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py +++ b/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py @@ -27,31 +27,30 @@ # import argparse import asyncio -from datetime import datetime + +# py38 only, See: https://github.com/PyCQA/pylint/issues/2976 +import collections # pylint: disable=syntax-error import importlib # py38 only, See: https://github.com/PyCQA/pylint/issues/2976 import inspect # pylint: disable=syntax-error import io import json - -# py38 only, See: https://github.com/PyCQA/pylint/issues/2976 -import collections # pylint: disable=syntax-error import os +import pickle import signal import sys import traceback +import uuid import zipfile +from datetime import datetime from zipimport import zipimporter -import pickle -import uuid sys_path_lock = None env_lock = None import ansible.module_utils.basic - please_include_me = "bar" @@ -180,8 +179,8 @@ class EmbeddedModule: from .exceptions import ( EmbeddedModuleFailure, - EmbeddedModuleUnexpectedFailure, EmbeddedModuleSuccess, + EmbeddedModuleUnexpectedFailure, ) # monkeypatching to pass the argument to the module, this is not |