[master 1/1] Point coverage.py to the full path of pyanaconda/

atodorov installerbot-noreply at redhat.com
Thu Oct 8 14:48:14 UTC 2015


From: Alexander Todorov <atodorov at redhat.com>

---
 anaconda | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/anaconda b/anaconda
index 939de1e..1d90548 100755
--- a/anaconda
+++ b/anaconda
@@ -37,10 +37,18 @@ coverage = None
 proc_cmdline = open("/proc/cmdline", "r").read()    # pylint: disable=interruptible-system-call
 proc_cmdline = proc_cmdline.split()
 if ("inst.debug=1" in proc_cmdline) or ("inst.debug" in proc_cmdline):
+    import os
+    import site
     import coverage
+    pyanaconda_dir = "pyanaconda"
+    for d in site.getsitepackages():
+        possible_dir = os.path.join(d, "pyanaconda")
+        if os.path.isdir(possible_dir):
+            pyanaconda_dir = possible_dir
+            break
     cov = coverage.coverage(data_file="/mnt/sysimage/root/anaconda.coverage",
                             branch=True,
-                            source=["/usr/sbin/anaconda", "pyanaconda"]
+                            source=["/usr/sbin/anaconda", pyanaconda_dir]
                             )
     cov.start()
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/64b058e4e8608ef4d776f5fcd4b0e458be1225ee


More information about the anaconda-patches mailing list