diff options
author | Allan <allanice001@users.noreply.github.com> | 2017-02-01 06:05:53 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2017-01-31 20:05:53 -0800 |
commit | ba39d1158c1e675e45d6e70c322ccb3f8713bdd1 (patch) | |
tree | f19053dd5abdc1367324cddbe7f896e8c4f9b19a /hacking | |
parent | 01f4d4a666342e7eb509fbd3a016078fb5180c3b (diff) | |
download | ansible-ba39d1158c1e675e45d6e70c322ccb3f8713bdd1.tar.gz |
Update test-module (#20737)
* Update test-module
Ensuring invoke is assigned
Traceback (most recent call last):
File "ansible/hacking/test-module", line 267, in <module>
main()
File "ansible/hacking/test-module", line 263, in main
runtest(modfile, argspath, modname, module_style, interpreters)
File "ansible/hacking/test-module", line 207, in runtest
invoke = "%s%s" % (invoke, modfile)
UnboundLocalError: local variable 'invoke' referenced before assignment
* Update test-module
Made the change to only require a single if, making the function more 'DRY'.
Diffstat (limited to 'hacking')
-rwxr-xr-x | hacking/test-module | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hacking/test-module b/hacking/test-module index 0301dd1452..3ef8bd65df 100755 --- a/hacking/test-module +++ b/hacking/test-module @@ -195,12 +195,11 @@ def ansiballz_setup(modfile, modname, interpreters): def runtest(modfile, argspath, modname, module_style, interpreters): """Test run a module, piping it's output for reporting.""" + invoke = "" if module_style == 'ansiballz': modfile, argspath = ansiballz_setup(modfile, modname, interpreters) if 'ansible_python_interpreter' in interpreters: invoke = "%s " % interpreters['ansible_python_interpreter'] - else: - invoke = "" os.system("chmod +x %s" % modfile) |