diff options
author | Brian Coca <brian.coca+git@gmail.com> | 2016-01-27 16:12:08 -0500 |
---|---|---|
committer | Brian Coca <brian.coca+git@gmail.com> | 2016-01-27 16:13:06 -0500 |
commit | c857b2004319786ff1529c3ea74470ffa1911004 (patch) | |
tree | 9c061daf39f8302b5729156baebe44cfe8a6585f | |
parent | 3f3e3e3d5bdf042a0ef733477673fa703d97ccba (diff) | |
download | ansible-c857b2004319786ff1529c3ea74470ffa1911004.tar.gz |
fixed issue with vars prompt warning causing error
sometimes display object is not magically available, use it explicitly,
no need to be classmethod anymore
fixes #14147
-rw-r--r-- | lib/ansible/utils/display.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/ansible/utils/display.py b/lib/ansible/utils/display.py index ba92723759..cd91af1a4f 100644 --- a/lib/ansible/utils/display.py +++ b/lib/ansible/utils/display.py @@ -278,13 +278,12 @@ class Display: else: return input(prompt_string) - @classmethod - def do_var_prompt(cls, varname, private=True, prompt=None, encrypt=None, confirm=False, salt_size=None, salt=None, default=None): + def do_var_prompt(self, varname, private=True, prompt=None, encrypt=None, confirm=False, salt_size=None, salt=None, default=None): result = None if sys.__stdin__.isatty(): - do_prompt = cls.prompt + do_prompt = self.prompt if prompt and default is not None: msg = "%s [%s]: " % (prompt, default) @@ -299,12 +298,12 @@ class Display: second = do_prompt("confirm " + msg, private) if result == second: break - display.display("***** VALUES ENTERED DO NOT MATCH ****") + self.display("***** VALUES ENTERED DO NOT MATCH ****") else: result = do_prompt(msg, private) else: result = None - display.warning("Not prompting as we are not in interactive mode") + self.warning("Not prompting as we are not in interactive mode") # if result is false and default is not None if not result and default is not None: |