Hi,
I think this may break fron-end code. When the user wants to download
the file and click "Download" button, the front-end query the URI given
from the back-end dict['file']. It should be a /data/xxx/path.
on 2014/03/13 15:01, Mark Wu wrote:
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}
--
Thanks and best regards!
Zhou Zheng Sheng / 周征晟
E-mail: zhshzhou(a)linux.vnet.ibm.com
Telephone: 86-10-82454397