tests: migration/guestperf Python 2.6 argparse compatibility
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 25 Aug 2017 15:57:32 +0000 (16:57 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 30 Aug 2017 11:02:11 +0000 (12:02 +0100)
Add the scripts/ directory to sys.path so Python 2.6 will be able to
import argparse.

Cc: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: John Snow <jsnow@redhat.com>
Acked-by: Fam Zheng <famz@redhat.com>
Message-id: 20170825155732.15665-4-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/migration/guestperf/shell.py

index 185c5697a6ed25740946c81b22e4368d3e1e7de7..7992459a972129e52f0e51151fe266061ed5cd08 100644 (file)
 #
 
 
-import argparse
-import fnmatch
 import os
 import os.path
-import platform
 import sys
+sys.path.append(os.path.join(os.path.dirname(__file__),
+                             '..', '..', '..', 'scripts'))
+import argparse
+import fnmatch
+import platform
 
 from guestperf.hardware import Hardware
 from guestperf.engine import Engine