From f02ea15f0c9c2833d139057ae3937cabae1cd6ae Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Mon, 25 Feb 2013 17:07:47 -0500 Subject: [PATCH] command: make sure that all _handle_aliases() calls returns {} module_common: also work if there are no aliases (shell, command, etc) modules --- lib/ansible/module_common.py | 8 +++----- library/command | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/ansible/module_common.py b/lib/ansible/module_common.py index d8b560e278e..24bd14ecbdd 100644 --- a/lib/ansible/module_common.py +++ b/lib/ansible/module_common.py @@ -592,11 +592,9 @@ class AnsibleModule(object): passwd_keys = ['password', 'login_password'] for param in self.params: - no_log = False - if self.aliases: - canon = self.aliases.get(param, param) - arg_opts = self.argument_spec[canon] - no_log = arg_opts.get('no_log', False) + canon = self.aliases.get(param, param) + arg_opts = self.argument_spec.get(canon, {}) + no_log = arg_opts.get('no_log', False) if no_log: log_args[param] = 'NOT_LOGGING_PARAMETER' diff --git a/library/command b/library/command index 13dbb089f63..4e43b9fa3c9 100644 --- a/library/command +++ b/library/command @@ -129,7 +129,7 @@ def main(): class CommandModule(AnsibleModule): def _handle_aliases(self): - pass + return {} def _check_invalid_arguments(self): pass