[Kimchi-devel] [PATCH] Report debug report's file path instead of uri path.
Mark Wu
wudxw at linux.vnet.ibm.com
Thu Mar 13 07:01:11 UTC 2014
Now the file path displayed on UI is "/data/debugreports/<reportname>/",
It's misleading because people could assume it's path on file system,
but it's the uri path in fact. We don't need expose the URI path because
the download button can help user to get the file.
---
docs/API.md | 2 +-
src/kimchi/model/debugreports.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index b3b6c49..dd3b470 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -668,7 +668,7 @@ specific to the low level collection tool being used.
* **GET**: Retrieve the full description of Debug Report
* name: The debug report name used to identify the report
- * file: The debug report file name used to identify the report
+ * file: The debug report's file path on kimchi host.
* time: The time when the debug report is created
* **DELETE**: Remove the Debug Report
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py
index c6e698b..3dca3ff 100644
--- a/src/kimchi/model/debugreports.py
+++ b/src/kimchi/model/debugreports.py
@@ -161,7 +161,7 @@ class DebugReportModel(object):
ctime = os.stat(file_target).st_ctime
ctime = time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime(ctime))
file_target = os.path.split(file_target)[-1]
- file_target = os.path.join("/data/debugreports", file_target)
+ file_target = os.path.join(path, file_target)
return {'file': file_target,
'ctime': ctime}
--
1.8.4.2
More information about the Kimchi-devel
mailing list