mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-05-07 05:43:04 +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 ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible.module_utils.six import with_metaclass
|
||||
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||
from ansible.parsing.ajson import AnsibleJSONEncoder
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
||||
@@ -158,7 +157,7 @@ def dict_fromkeys(keys, default=None):
|
||||
return d
|
||||
|
||||
|
||||
class BaseProf(with_metaclass(ABCMeta, threading.Thread)):
|
||||
class BaseProf(threading.Thread, metaclass=ABCMeta):
|
||||
def __init__(self, path, obj=None, writer=None):
|
||||
threading.Thread.__init__(self) # pylint: disable=non-parent-init-called
|
||||
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/shell/csh.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/shell/csh.py pylint:ansible-bad-import-from
|
||||
plugins/shell/fish.py pylint:ansible-bad-import-from
|
||||
|
||||
Reference in New Issue
Block a user