mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
parent
37de9031c6
commit
8cab33a779
1 changed files with 8 additions and 1 deletions
|
@ -6,13 +6,20 @@ import pickle
|
||||||
import unittest
|
import unittest
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
try:
|
||||||
|
from vmware_inventory import VMWareInventory
|
||||||
|
except ImportError:
|
||||||
|
from nose.plugins.skip import SkipTest
|
||||||
|
raise SkipTest("test_vmware_inventory.py requires the python module 'vmware_inventory'")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# contrib's dirstruct doesn't contain __init__.py files
|
# contrib's dirstruct doesn't contain __init__.py files
|
||||||
checkout_path = os.path.dirname(__file__)
|
checkout_path = os.path.dirname(__file__)
|
||||||
checkout_path = checkout_path.replace('/test/units/contrib/inventory', '')
|
checkout_path = checkout_path.replace('/test/units/contrib/inventory', '')
|
||||||
inventory_dir = os.path.join(checkout_path, 'contrib', 'inventory')
|
inventory_dir = os.path.join(checkout_path, 'contrib', 'inventory')
|
||||||
sys.path.append(os.path.abspath(inventory_dir))
|
sys.path.append(os.path.abspath(inventory_dir))
|
||||||
from vmware_inventory import VMWareInventory
|
|
||||||
# cleanup so that nose's path is not polluted with other inv scripts
|
# cleanup so that nose's path is not polluted with other inv scripts
|
||||||
sys.path.remove(os.path.abspath(inventory_dir))
|
sys.path.remove(os.path.abspath(inventory_dir))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue