All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: kvm@vger.kernel.org
Subject: [PATCH] kvm-autotest: write relative path in html report
Date: Wed, 25 Mar 2009 10:18:59 -0500	[thread overview]
Message-ID: <20090325151859.GK27104@us.ibm.com> (raw)

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

             reply	other threads:[~2009-03-25 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25 15:18 Ryan Harper [this message]
2009-03-29 16:31 ` [PATCH] kvm-autotest: write relative path in html report Uri Lublin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090325151859.GK27104@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.