From c48a8d56d8d469465df5c44a7715062bf8c6f313 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Sat, 18 Feb 2017 17:46:08 +0100 Subject: Insert paths in the second position of sys.path http://stackoverflow.com/a/10097543/4804690 Additionally, avoid using platform-specific '/' and '..'. --- .../test/openshift_master_facts_default_predicates_tests.py | 2 +- .../test/openshift_master_facts_default_priorities_tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'roles') diff --git a/roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py b/roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py index 5013d1302..94c4495c9 100644 --- a/roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py +++ b/roles/openshift_master_facts/test/openshift_master_facts_default_predicates_tests.py @@ -5,7 +5,7 @@ import sys from ansible.errors import AnsibleError from nose.tools import raises, assert_equal -sys.path = [os.path.abspath(os.path.dirname(__file__) + "/../lookup_plugins/")] + sys.path +sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, "lookup_plugins")) from openshift_master_facts_default_predicates import LookupModule # noqa: E402 diff --git a/roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py b/roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py index 7ddc5dcb2..0bcd240d6 100644 --- a/roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py +++ b/roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py @@ -5,7 +5,7 @@ import sys from ansible.errors import AnsibleError from nose.tools import raises, assert_equal -sys.path = [os.path.abspath(os.path.dirname(__file__) + "/../lookup_plugins/")] + sys.path +sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, "lookup_plugins")) from openshift_master_facts_default_priorities import LookupModule # noqa: E402 -- cgit v1.2.1