1 Apr 2012 18:21
[PATCH] client/tools/scan_results.py: Make program to run from any directory
Lucas Meneghel Rodrigues <lmr <at> redhat.com>
2012-04-01 16:21:46 GMT
2012-04-01 16:21:46 GMT
We actually forgot to fix this a long time ago, but it's
far more convenient to make scan_results.py to execute from
any diretory. Do this by figuring out the path for the script,
and then deducing the path to the results file by relative
positioning.
Special thanks to Alex Jia <ajia <at> redhat.com> for sending
a preliminary fix for the problem.
Signed-off-by: Lucas Meneghel Rodrigues <lmr <at> redhat.com>
---
client/tools/scan_results.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/client/tools/scan_results.py b/client/tools/scan_results.py
index 71dddde..37efd35 100755
--- a/client/tools/scan_results.py
+++ b/client/tools/scan_results.py
<at> <at> -90,9 +90,11 <at> <at> def main(resfiles):
if __name__ == "__main__":
- import sys, glob
+ import sys, glob, os
+ dirname = os.path.dirname(sys.modules[__name__].__file__)
+ client_dir = os.path.abspath(os.path.join(dirname, ".."))
+ resfiles = glob.glob(os.path.join(client_dir, 'results', 'default', 'status*'))
- resfiles = glob.glob("../../results/default/status*")
if len(sys.argv) > 1:
(Continue reading)
RSS Feed