Protect against p_opt not having prompt attribute

In ansible/ansible#28746 it was reported that there are times
when a p_opt is getting here that does not have a prompt
attribute. Protecting against that is fairly easy to do.

Change-Id: Ia02528f4a107893e480135bc214aa156b8684507
Closes-Bug: #1717906
This commit is contained in:
Monty Taylor 2017-09-21 09:06:24 -05:00
parent be9da751a2
commit 3bb4c37c88
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594

View File

@ -961,7 +961,7 @@ class OpenStackConfig(object):
def option_prompt(self, config, p_opt):
"""Prompt user for option that requires a value"""
if (
p_opt.prompt is not None and
getattr(p_opt, 'prompt', None) is not None and
p_opt.dest not in config['auth'] and
self._pw_callback is not None
):