mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
Add a Singleton metaclass, use it with Display (#48935)
* Add a Singleton class, use it with Display * update six import * Move remaining failes to display singleton * Fix rebase issues * Singleton improvements * Add code-smell for 'from __main__ import display'. ci_complete * s/self/cls/g * Add docs for no-main-display * Address linting issues * Add changelog fragment. ci_complete * Implement reentrant lock for class instantiation in Singleton * Add Display singleton porting guide
This commit is contained in:
parent
54a2f21f93
commit
9773a1f289
149 changed files with 407 additions and 766 deletions
|
@ -36,7 +36,9 @@ from termios import TIOCGWINSZ
|
|||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible.module_utils.six import with_metaclass
|
||||
from ansible.utils.color import stringc
|
||||
from ansible.utils.singleton import Singleton
|
||||
|
||||
|
||||
try:
|
||||
|
@ -77,7 +79,7 @@ b_COW_PATHS = (
|
|||
)
|
||||
|
||||
|
||||
class Display:
|
||||
class Display(with_metaclass(Singleton, object)):
|
||||
|
||||
def __init__(self, verbosity=0):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue