[PATCH v2] Report debug report's file path instead of uri path.

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 | 3 ++- src/kimchi/control/debugreports.py | 1 + src/kimchi/model/debugreports.py | 6 ++++-- ui/js/src/kimchi.host.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/API.md b/docs/API.md index b3b6c49..6f4f03a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -668,7 +668,8 @@ 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 + * uri: The URI path to download this debug report * time: The time when the debug report is created * **DELETE**: Remove the Debug Report diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py index 9922cfa..d6ca620 100644 --- a/src/kimchi/control/debugreports.py +++ b/src/kimchi/control/debugreports.py @@ -38,6 +38,7 @@ class DebugReport(Resource): def data(self): return {'name': self.ident, 'file': self.info['file'], + 'uri': self.info['uri'], 'time': self.info['ctime']} diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py index c6e698b..b144496 100644 --- a/src/kimchi/model/debugreports.py +++ b/src/kimchi/model/debugreports.py @@ -161,8 +161,10 @@ 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) - return {'file': file_target, + file_path = os.path.join(path, file_target) + uri_path = os.path.join("/data/debugreports", file_target) + return {'file': file_path, + 'uri': uri_path, 'ctime': ctime} def delete(self, name): diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js index 7974054..0aaf2f0 100644 --- a/ui/js/src/kimchi.host.js +++ b/ui/js/src/kimchi.host.js @@ -87,7 +87,7 @@ kimchi.host_main = function() { } kimchi.downloadReport({ - file: report['file'] + file: report['uri'] }); } }], -- 1.8.4.2

Reviewed-By: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com> on 2014/03/13 17:27, 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 | 3 ++- src/kimchi/control/debugreports.py | 1 + src/kimchi/model/debugreports.py | 6 ++++-- ui/js/src/kimchi.host.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/API.md b/docs/API.md index b3b6c49..6f4f03a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -668,7 +668,8 @@ 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 + * uri: The URI path to download this debug report * time: The time when the debug report is created
* **DELETE**: Remove the Debug Report diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py index 9922cfa..d6ca620 100644 --- a/src/kimchi/control/debugreports.py +++ b/src/kimchi/control/debugreports.py @@ -38,6 +38,7 @@ class DebugReport(Resource): def data(self): return {'name': self.ident, 'file': self.info['file'], + 'uri': self.info['uri'], 'time': self.info['ctime']}
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py index c6e698b..b144496 100644 --- a/src/kimchi/model/debugreports.py +++ b/src/kimchi/model/debugreports.py @@ -161,8 +161,10 @@ 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) - return {'file': file_target, + file_path = os.path.join(path, file_target) + uri_path = os.path.join("/data/debugreports", file_target) + return {'file': file_path, + 'uri': uri_path, 'ctime': ctime}
def delete(self, name): diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js index 7974054..0aaf2f0 100644 --- a/ui/js/src/kimchi.host.js +++ b/ui/js/src/kimchi.host.js @@ -87,7 +87,7 @@ kimchi.host_main = function() { }
kimchi.downloadReport({ - file: report['file'] + file: report['uri'] }); } }],
-- Thanks and best regards! Zhou Zheng Sheng / 周征晟 E-mail: zhshzhou@linux.vnet.ibm.com Telephone: 86-10-82454397

Reviewed-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> On 03/13/2014 05:27 PM, 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 | 3 ++- src/kimchi/control/debugreports.py | 1 + src/kimchi/model/debugreports.py | 6 ++++-- ui/js/src/kimchi.host.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/API.md b/docs/API.md index b3b6c49..6f4f03a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -668,7 +668,8 @@ 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 + * uri: The URI path to download this debug report * time: The time when the debug report is created
* **DELETE**: Remove the Debug Report diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py index 9922cfa..d6ca620 100644 --- a/src/kimchi/control/debugreports.py +++ b/src/kimchi/control/debugreports.py @@ -38,6 +38,7 @@ class DebugReport(Resource): def data(self): return {'name': self.ident, 'file': self.info['file'], + 'uri': self.info['uri'], 'time': self.info['ctime']}
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py index c6e698b..b144496 100644 --- a/src/kimchi/model/debugreports.py +++ b/src/kimchi/model/debugreports.py @@ -161,8 +161,10 @@ 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) - return {'file': file_target, + file_path = os.path.join(path, file_target) + uri_path = os.path.join("/data/debugreports", file_target) + return {'file': file_path, + 'uri': uri_path, 'ctime': ctime}
def delete(self, name): diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js index 7974054..0aaf2f0 100644 --- a/ui/js/src/kimchi.host.js +++ b/ui/js/src/kimchi.host.js @@ -87,7 +87,7 @@ kimchi.host_main = function() { }
kimchi.downloadReport({ - file: report['file'] + file: report['uri'] }); } }],
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

Where is the Signed-off-by? On 03/13/2014 05:27 PM, 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 | 3 ++- src/kimchi/control/debugreports.py | 1 + src/kimchi/model/debugreports.py | 6 ++++-- ui/js/src/kimchi.host.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/API.md b/docs/API.md index b3b6c49..6f4f03a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -668,7 +668,8 @@ 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 + * uri: The URI path to download this debug report * time: The time when the debug report is created
* **DELETE**: Remove the Debug Report diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py index 9922cfa..d6ca620 100644 --- a/src/kimchi/control/debugreports.py +++ b/src/kimchi/control/debugreports.py @@ -38,6 +38,7 @@ class DebugReport(Resource): def data(self): return {'name': self.ident, 'file': self.info['file'], + 'uri': self.info['uri'], 'time': self.info['ctime']}
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py index c6e698b..b144496 100644 --- a/src/kimchi/model/debugreports.py +++ b/src/kimchi/model/debugreports.py @@ -161,8 +161,10 @@ 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) - return {'file': file_target, + file_path = os.path.join(path, file_target) + uri_path = os.path.join("/data/debugreports", file_target) + return {'file': file_path, + 'uri': uri_path, 'ctime': ctime}
def delete(self, name): diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js index 7974054..0aaf2f0 100644 --- a/ui/js/src/kimchi.host.js +++ b/ui/js/src/kimchi.host.js @@ -87,7 +87,7 @@ kimchi.host_main = function() { }
kimchi.downloadReport({ - file: report['file'] + file: report['uri'] }); } }],

On 03/13/2014 06:27 AM, 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.
This is that way because we don't like to expose host file system structure to the user.
--- docs/API.md | 3 ++- src/kimchi/control/debugreports.py | 1 + src/kimchi/model/debugreports.py | 6 ++++-- ui/js/src/kimchi.host.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/API.md b/docs/API.md index b3b6c49..6f4f03a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -668,7 +668,8 @@ 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 + * uri: The URI path to download this debug report * time: The time when the debug report is created
* **DELETE**: Remove the Debug Report diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py index 9922cfa..d6ca620 100644 --- a/src/kimchi/control/debugreports.py +++ b/src/kimchi/control/debugreports.py @@ -38,6 +38,7 @@ class DebugReport(Resource): def data(self): return {'name': self.ident, 'file': self.info['file'], + 'uri': self.info['uri'], 'time': self.info['ctime']}
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py index c6e698b..b144496 100644 --- a/src/kimchi/model/debugreports.py +++ b/src/kimchi/model/debugreports.py @@ -161,8 +161,10 @@ 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) - return {'file': file_target, + file_path = os.path.join(path, file_target) + uri_path = os.path.join("/data/debugreports", file_target) + return {'file': file_path, + 'uri': uri_path, 'ctime': ctime}
def delete(self, name): diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js index 7974054..0aaf2f0 100644 --- a/ui/js/src/kimchi.host.js +++ b/ui/js/src/kimchi.host.js @@ -87,7 +87,7 @@ kimchi.host_main = function() { }
kimchi.downloadReport({ - file: report['file'] + file: report['uri'] }); } }],

On 03/13/2014 06:27 AM, 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.
This is that way because we don't like to expose host file system structure to the user. I considered this issue, but I think it's not bad to let user know the
On 03/13/2014 09:18 PM, Aline Manera wrote: patch. With this info, they can have some self-help service. It seems it doesn't comply with kimchi's design principles . So I am going to remove the column from UI.
--- docs/API.md | 3 ++- src/kimchi/control/debugreports.py | 1 + src/kimchi/model/debugreports.py | 6 ++++-- ui/js/src/kimchi.host.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/API.md b/docs/API.md index b3b6c49..6f4f03a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -668,7 +668,8 @@ 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 + * uri: The URI path to download this debug report * time: The time when the debug report is created
* **DELETE**: Remove the Debug Report diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py index 9922cfa..d6ca620 100644 --- a/src/kimchi/control/debugreports.py +++ b/src/kimchi/control/debugreports.py @@ -38,6 +38,7 @@ class DebugReport(Resource): def data(self): return {'name': self.ident, 'file': self.info['file'], + 'uri': self.info['uri'], 'time': self.info['ctime']}
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py index c6e698b..b144496 100644 --- a/src/kimchi/model/debugreports.py +++ b/src/kimchi/model/debugreports.py @@ -161,8 +161,10 @@ 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) - return {'file': file_target, + file_path = os.path.join(path, file_target) + uri_path = os.path.join("/data/debugreports", file_target) + return {'file': file_path, + 'uri': uri_path, 'ctime': ctime}
def delete(self, name): diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js index 7974054..0aaf2f0 100644 --- a/ui/js/src/kimchi.host.js +++ b/ui/js/src/kimchi.host.js @@ -87,7 +87,7 @@ kimchi.host_main = function() { }
kimchi.downloadReport({ - file: report['file'] + file: report['uri'] }); } }],

2014/3/13 17:27, Mark Wu:
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 | 3 ++- src/kimchi/control/debugreports.py | 1 + src/kimchi/model/debugreports.py | 6 ++++-- ui/js/src/kimchi.host.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/API.md b/docs/API.md index b3b6c49..6f4f03a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -668,7 +668,8 @@ 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 + * uri: The URI path to download this debug report * time: The time when the debug report is created
* **DELETE**: Remove the Debug Report diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py index 9922cfa..d6ca620 100644 --- a/src/kimchi/control/debugreports.py +++ b/src/kimchi/control/debugreports.py @@ -38,6 +38,7 @@ class DebugReport(Resource): def data(self): return {'name': self.ident, 'file': self.info['file'], + 'uri': self.info['uri'], 'time': self.info['ctime']}
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py index c6e698b..b144496 100644 --- a/src/kimchi/model/debugreports.py +++ b/src/kimchi/model/debugreports.py @@ -161,8 +161,10 @@ 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) - return {'file': file_target, + file_path = os.path.join(path, file_target) + uri_path = os.path.join("/data/debugreports", file_target) + return {'file': file_path, It seems that the front end doesn't care about the host file path. Why not just rename 'file' to 'uri' instead of adding another one 'uri'?
+ 'uri': uri_path, 'ctime': ctime}
def delete(self, name): diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js index 7974054..0aaf2f0 100644 --- a/ui/js/src/kimchi.host.js +++ b/ui/js/src/kimchi.host.js @@ -87,7 +87,7 @@ kimchi.host_main = function() { }
kimchi.downloadReport({ - file: report['file'] + file: report['uri'] }); } }],

On 03/13/2014 11:05 PM, Shu Ming wrote:
2014/3/13 17:27, Mark Wu:
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 | 3 ++- src/kimchi/control/debugreports.py | 1 + src/kimchi/model/debugreports.py | 6 ++++-- ui/js/src/kimchi.host.js | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/API.md b/docs/API.md index b3b6c49..6f4f03a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -668,7 +668,8 @@ 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 + * uri: The URI path to download this debug report * time: The time when the debug report is created
* **DELETE**: Remove the Debug Report diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py index 9922cfa..d6ca620 100644 --- a/src/kimchi/control/debugreports.py +++ b/src/kimchi/control/debugreports.py @@ -38,6 +38,7 @@ class DebugReport(Resource): def data(self): return {'name': self.ident, 'file': self.info['file'], + 'uri': self.info['uri'], 'time': self.info['ctime']}
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py index c6e698b..b144496 100644 --- a/src/kimchi/model/debugreports.py +++ b/src/kimchi/model/debugreports.py @@ -161,8 +161,10 @@ 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) - return {'file': file_target, + file_path = os.path.join(path, file_target) + uri_path = os.path.join("/data/debugreports", file_target) + return {'file': file_path, It seems that the front end doesn't care about the host file path. Why not just rename 'file' to 'uri' instead of adding another one 'uri'?
I don't think the uri path is useful for user. So we don't need expose this information.
+ 'uri': uri_path, 'ctime': ctime}
def delete(self, name): diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js index 7974054..0aaf2f0 100644 --- a/ui/js/src/kimchi.host.js +++ b/ui/js/src/kimchi.host.js @@ -87,7 +87,7 @@ kimchi.host_main = function() { }
kimchi.downloadReport({ - file: report['file'] + file: report['uri'] }); } }],
participants (6)
-
Aline Manera
-
Hongliang Wang
-
Mark Wu
-
Sheldon
-
Shu Ming
-
Zhou Zheng Sheng