diff mbox series

[nft] tests/py: fix import when run from other directory

Message ID 20180621144747.24241-1-eric@regit.org
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft] tests/py: fix import when run from other directory | expand

Commit Message

Eric Leblond June 21, 2018, 2:47 p.m. UTC
Signed-off-by: Eric Leblond <eric@regit.org>
---
 tests/py/nft-test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Pablo Neira Ayuso June 21, 2018, 4:26 p.m. UTC | #1
Applied, thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 1c736be..e4367ad 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -19,11 +19,11 @@  import argparse
 import signal
 import json
 
-sys.path.insert(0,'../../py/')
+TESTS_PATH = os.path.dirname(os.path.abspath(__file__))
+sys.path.insert(0, os.path.join(TESTS_PATH, '../../py/'))
 
 from nftables import Nftables
 
-TESTS_PATH = os.path.dirname(os.path.abspath(__file__))
 TESTS_DIRECTORY = ["any", "arp", "bridge", "inet", "ip", "ip6"]
 LOGFILE = "/tmp/nftables-test.log"
 log_file = None