ansible/lib/ansible
Jim Gu 853236d650 VMware: Avoid misleading PyVmomi error if requests import fails
* Avoid misleading PyVmomi error if requests import fails

Requests is imported by the VMware module_utils as an external
dependency; however, because it is in a try/catch block containing the
imports for PyVmomi, if requests fails to import properly, Ansible will
instead complain about PyVmomi not being installed.

By moving the import outside of the try/catch block, if requests fails
to import, an error like the following will be returned:

    ImportError: No module named requests

This should result in less confusion.

* catch requests ImportError

Signed-off-by: Jim Gu <jim@jimgu.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

(cherry picked from commit 99ee30768a)
2018-10-31 08:23:32 -07:00
..
cli [stable-2.7] Fix from sivel for ansible-doc 2018-10-25 12:49:58 -07:00
compat Fix the local and ssh plugins for a cornercase retrying a syscall 2018-08-13 07:17:11 -07:00
config [stable-2.7] Fix issues with PLUGIN_FILTERS_CFG config handling (#45994) 2018-10-09 10:55:46 -07:00
errors
executor [stable-2.7] Don't use the task for a cache, return a special cache var (#47243) 2018-10-22 10:33:19 -07:00
galaxy [WIP] Backport/2.7/second batch (#45927) 2018-09-20 14:10:39 -05:00
inventory better information for user from inventory plugins (#46766) 2018-10-12 10:38:57 -07:00
module_utils VMware: Avoid misleading PyVmomi error if requests import fails 2018-10-31 08:23:32 -07:00
modules Better description for the ce_vlan module (#47816) (#47819) 2018-10-30 14:55:33 -05:00
parsing fixes to ansible-doc (#47209) 2018-10-17 11:40:02 -05:00
playbook [stable-2.7] Ensure we don't overwrite roles from include/import_role when loading the play (#47512) 2018-10-23 12:29:12 -07:00
plugins 2.7: adds 'success_msg' to valid args for assert module (#47030) (#47584) 2018-10-25 15:20:26 -07:00
template Do not strip new lines in native jinja (#46751) 2018-10-22 09:47:45 -07:00
utils [stable-2.7] Handle sets differently than lists in wrap_var. Fixes #47372 (#47510). 2018-10-23 12:30:15 -07:00
vars [stable-2.7] Don't use the task for a cache, return a special cache var (#47243) 2018-10-22 10:33:19 -07:00
__init__.py
constants.py [stable-2.7] Fix from sivel for ansible-doc 2018-10-25 12:49:58 -07:00
release.py Update version to show we're in a checkout 2018-10-25 15:05:03 -07:00