mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-07-31 11:54:52 +00:00
Fix deprecated imports in plugins/callback/cgroup_perf_recap.py
Replace deprecated module_utils imports: - ansible.module_utils._text -> ansible.module_utils.common.text.converters - ansible.module_utils.six.with_metaclass -> Python 3 metaclass syntax Fixes #686 Co-authored-by: Cursor AI Signed-off-by: Pavel Bar <pbar@redhat.com>
This commit is contained in:
@@ -141,8 +141,7 @@ from abc import ABCMeta, abstractmethod
|
|||||||
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from ansible.module_utils._text import to_bytes, to_text
|
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||||
from ansible.module_utils.six import with_metaclass
|
|
||||||
from ansible.parsing.ajson import AnsibleJSONEncoder
|
from ansible.parsing.ajson import AnsibleJSONEncoder
|
||||||
from ansible.plugins.callback import CallbackBase
|
from ansible.plugins.callback import CallbackBase
|
||||||
|
|
||||||
@@ -158,7 +157,7 @@ def dict_fromkeys(keys, default=None):
|
|||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
||||||
class BaseProf(with_metaclass(ABCMeta, threading.Thread)):
|
class BaseProf(threading.Thread, metaclass=ABCMeta):
|
||||||
def __init__(self, path, obj=None, writer=None):
|
def __init__(self, path, obj=None, writer=None):
|
||||||
threading.Thread.__init__(self) # pylint: disable=non-parent-init-called
|
threading.Thread.__init__(self) # pylint: disable=non-parent-init-called
|
||||||
self.obj = obj
|
self.obj = obj
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
plugins/callback/cgroup_perf_recap.py pylint:ansible-bad-import-from
|
|
||||||
plugins/modules/sysctl.py pylint:ansible-bad-import-from
|
plugins/modules/sysctl.py pylint:ansible-bad-import-from
|
||||||
plugins/shell/csh.py pylint:ansible-bad-import-from
|
plugins/shell/csh.py pylint:ansible-bad-import-from
|
||||||
plugins/shell/fish.py pylint:ansible-bad-import-from
|
plugins/shell/fish.py pylint:ansible-bad-import-from
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
plugins/callback/cgroup_perf_recap.py pylint:ansible-bad-import-from
|
|
||||||
plugins/modules/sysctl.py pylint:ansible-bad-import-from
|
plugins/modules/sysctl.py pylint:ansible-bad-import-from
|
||||||
plugins/shell/csh.py pylint:ansible-bad-import-from
|
plugins/shell/csh.py pylint:ansible-bad-import-from
|
||||||
plugins/shell/fish.py pylint:ansible-bad-import-from
|
plugins/shell/fish.py pylint:ansible-bad-import-from
|
||||||
|
|||||||
Reference in New Issue
Block a user