kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm-autotest: write relative path in html report
@ 2009-03-25 15:18 Ryan Harper
  2009-03-29 16:31 ` Uri Lublin
  0 siblings, 1 reply; 2+ messages in thread
From: Ryan Harper @ 2009-03-25 15:18 UTC (permalink / raw)
  To: kvm

When generating an html report from make_html_report.py, one needs to
supply the full path to the results directory.  This value ends up being
embedded in the output which breaks relocating the results dir to a
different path.  This patch adds a new flag that supresses the full path
value when generating the report.  I'm looking to generate a summary
html report in the results dir and relocate the results dir to a
different server which can be done with this patch.

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com

diffstat output:
 make_html_report.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
---
diff --git a/client/tests/kvm_runtest_2/make_html_report.py b/client/tests/kvm_runtest_2/make_html_report.py
index ddb896f..3d0326a 100755
--- a/client/tests/kvm_runtest_2/make_html_report.py
+++ b/client/tests/kvm_runtest_2/make_html_report.py
@@ -1655,8 +1655,9 @@ def get_kvm_version(result_dir):
 def main(argv):
     dirname = None
     output_file_name = None
+    relative_path = False
     try:
-        opts, args = getopt.getopt(argv, "r:f:h", ['help'])
+        opts, args = getopt.getopt(argv, "r:f:h:R", ['help'])
     except getopt.GetoptError:
         usage()
         sys.exit(2)
@@ -1668,10 +1669,17 @@ def main(argv):
             dirname =  arg
         elif opt == '-f':
             output_file_name =  arg
+        elif opt == '-R':
+            relative_path = True
         else:
             usage()
             sys.exit(1)
 
+    html_path = dirname
+    # don't use absolute path in html output if relative flag passed
+    if relative_path:
+        html_path = ''
+
     if dirname:
         if os.path.isdir(dirname): # TBD: replace it with a validation of autotest result dir
             res_dir = os.path.abspath(dirname)
@@ -1704,7 +1712,7 @@ def main(argv):
                         'kvmver':get_kvm_version(dirname)
             }
 
-            make_html_file(metalist, results_data, tag, host, output_file_name, dirname)
+            make_html_file(metalist, results_data, tag, host, output_file_name, html_path)
             sys.exit(0)
         else:
             print 'Invalid result directory <%s>' % dirname

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kvm-autotest: write relative path in html report
  2009-03-25 15:18 [PATCH] kvm-autotest: write relative path in html report Ryan Harper
@ 2009-03-29 16:31 ` Uri Lublin
  0 siblings, 0 replies; 2+ messages in thread
From: Uri Lublin @ 2009-03-29 16:31 UTC (permalink / raw)
  To: Ryan Harper; +Cc: kvm

Ryan Harper wrote:
> When generating an html report from make_html_report.py, one needs to
> supply the full path to the results directory.  This value ends up being
> embedded in the output which breaks relocating the results dir to a
> different path.  This patch adds a new flag that supresses the full path
> value when generating the report.  I'm looking to generate a summary
> html report in the results dir and relocate the results dir to a
> different server which can be done with this patch.
> 

Applied.

I've made the following 2 modifications to the commit log:
1. replaced "kvm-autotest:" with "make_html_report:" on the first line.
2. added the following note to the commit message:
     Uri: Note that this only works when the html report is generated
          (or copied to) the results directory. In other words
          make_html_report.py -R -r <result-dir> -f <file-in-result-dir>


It can also be achieved with the following (which is not as convenient):
   cd <results-dir>; <runtest_2>/make_html_report.py -r . -f <report.html>

Next, I'm going to change the default control to use this switch.

Thanks,
     Uri

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-29 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-25 15:18 [PATCH] kvm-autotest: write relative path in html report Ryan Harper
2009-03-29 16:31 ` Uri Lublin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).