Clarify error message when module replacer encounters a bad import line for module_utils code

pull/14473/head
Toshio Kuratomi 9 years ago
parent 5ebd5c548c
commit 3e2b2b359c

@ -97,7 +97,7 @@ def _find_snippet_imports(module_data, module_path, strip_comments):
if " import *" not in line: if " import *" not in line:
import_error = True import_error = True
if import_error: 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_name = tokens[2].split()[0]
snippet_names.append(snippet_name) snippet_names.append(snippet_name)
output.write(_slurp(os.path.join(_SNIPPET_PATH, snippet_name + ".py"))) output.write(_slurp(os.path.join(_SNIPPET_PATH, snippet_name + ".py")))

Loading…
Cancel
Save