<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 03/13/2014 09:18 PM, Aline Manera
wrote:<br>
</div>
<blockquote cite="mid:5321B01C.6060309@linux.vnet.ibm.com"
type="cite">On 03/13/2014 06:27 AM, Mark Wu wrote:
<br>
<blockquote type="cite">Now the file path displayed on UI is
"/data/debugreports/<reportname>/",
<br>
It's misleading because people could assume it's path on file
system,
<br>
but it's the uri path in fact. We don't need expose the URI path
because
<br>
the download button can help user to get the file.
<br>
</blockquote>
<br>
This is that way because we don't like to expose host file system
structure to the user.
<br>
</blockquote>
I considered this issue, but I think it's not bad to let user know
the patch. With this info, they can have<br>
some self-help service. It seems it doesn't comply with kimchi's
design principles
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
. So I am going to remove the column from UI.<br>
<br>
<blockquote cite="mid:5321B01C.6060309@linux.vnet.ibm.com"
type="cite">
<br>
<blockquote type="cite">---
<br>
docs/API.md | 3 ++-
<br>
src/kimchi/control/debugreports.py | 1 +
<br>
src/kimchi/model/debugreports.py | 6 ++++--
<br>
ui/js/src/kimchi.host.js | 2 +-
<br>
4 files changed, 8 insertions(+), 4 deletions(-)
<br>
<br>
diff --git a/docs/API.md b/docs/API.md
<br>
index b3b6c49..6f4f03a 100644
<br>
--- a/docs/API.md
<br>
+++ b/docs/API.md
<br>
@@ -668,7 +668,8 @@ specific to the low level collection tool
being used.
<br>
<br>
* **GET**: Retrieve the full description of Debug Report
<br>
* name: The debug report name used to identify the report
<br>
- * file: The debug report file name used to identify the
report
<br>
+ * file: The debug report's file path on kimchi host
<br>
+ * uri: The URI path to download this debug report
<br>
* time: The time when the debug report is created
<br>
<br>
* **DELETE**: Remove the Debug Report
<br>
diff --git a/src/kimchi/control/debugreports.py
b/src/kimchi/control/debugreports.py
<br>
index 9922cfa..d6ca620 100644
<br>
--- a/src/kimchi/control/debugreports.py
<br>
+++ b/src/kimchi/control/debugreports.py
<br>
@@ -38,6 +38,7 @@ class DebugReport(Resource):
<br>
def data(self):
<br>
return {'name': self.ident,
<br>
'file': self.info['file'],
<br>
+ 'uri': self.info['uri'],
<br>
'time': self.info['ctime']}
<br>
<br>
<br>
diff --git a/src/kimchi/model/debugreports.py
b/src/kimchi/model/debugreports.py
<br>
index c6e698b..b144496 100644
<br>
--- a/src/kimchi/model/debugreports.py
<br>
+++ b/src/kimchi/model/debugreports.py
<br>
@@ -161,8 +161,10 @@ class DebugReportModel(object):
<br>
ctime = os.stat(file_target).st_ctime
<br>
ctime = time.strftime("%Y-%m-%d-%H:%M:%S",
time.localtime(ctime))
<br>
file_target = os.path.split(file_target)[-1]
<br>
- file_target = os.path.join("/data/debugreports",
file_target)
<br>
- return {'file': file_target,
<br>
+ file_path = os.path.join(path, file_target)
<br>
+ uri_path = os.path.join("/data/debugreports",
file_target)
<br>
+ return {'file': file_path,
<br>
+ 'uri': uri_path,
<br>
'ctime': ctime}
<br>
<br>
def delete(self, name):
<br>
diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
<br>
index 7974054..0aaf2f0 100644
<br>
--- a/ui/js/src/kimchi.host.js
<br>
+++ b/ui/js/src/kimchi.host.js
<br>
@@ -87,7 +87,7 @@ kimchi.host_main = function() {
<br>
}
<br>
<br>
kimchi.downloadReport({
<br>
- file: report['file']
<br>
+ file: report['uri']
<br>
});
<br>
}
<br>
}],
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>