Skip to content

Commit

Permalink
Clarify error message when module replacer encounters a bad import li…
Browse files Browse the repository at this point in the history
…ne for module_utils code
  • Loading branch information
abadger committed Feb 10, 2016
1 parent d9dcb2a commit 486304b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/executor/module_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _find_snippet_imports(module_data, module_path, strip_comments):
if " import *" not in line:
import_error = True
if import_error:
raise AnsibleError("error importing module in %s, expecting format like 'from ansible.module_utils.basic import *'" % module_path)
raise AnsibleError("error importing module in %s, expecting format like 'from ansible.module_utils.<lib name> import *'" % module_path)
snippet_name = tokens[2].split()[0]
snippet_names.append(snippet_name)
output.write(_slurp(os.path.join(_SNIPPET_PATH, snippet_name + ".py")))
Expand Down

0 comments on commit 486304b

Please sign in to comment.