[Kimchi-devel] [PATCH v3] Remove debug report's file path from UI

Aline Manera alinefm at linux.vnet.ibm.com
Tue Mar 18 18:14:09 UTC 2014


The tests are failing with this patch set:

======================================================================
ERROR: test_create_debugreport (test_rest.HttpsRestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/home/alinefm/kimchi/tests/test_rest.py", line 1489, in 
test_create_debugreport
     self.assertEquals("report1", debugreport['name'])
KeyError: 'name'

======================================================================
ERROR: test_debugreport_download (test_rest.HttpsRestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/home/alinefm/kimchi/tests/test_rest.py", line 1504, in 
test_debugreport_download
     self.assertEquals("report1", debugreport['name'])
KeyError: 'name'

======================================================================
ERROR: test_create_debugreport (test_rest.RestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/home/alinefm/kimchi/tests/test_rest.py", line 1489, in 
test_create_debugreport
     self.assertEquals("report1", debugreport['name'])
KeyError: 'name'

======================================================================
ERROR: test_debugreport_download (test_rest.RestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/home/alinefm/kimchi/tests/test_rest.py", line 1504, in 
test_debugreport_download
     self.assertEquals("report1", debugreport['name'])
KeyError: 'name'

----------------------------------------------------------------------
Ran 158 tests in 166.389s

FAILED (errors=4)
make[3]: *** [check-local] Error 1
make[3]: Leaving directory `/home/alinefm/kimchi/tests'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/alinefm/kimchi/tests'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/home/alinefm/kimchi/tests'
make: *** [check-recursive] Error 1


On 03/13/2014 11:43 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. So this patch removes
> it from UI.  And this patch also renames debug report's 'file' attribute
> to 'uri', because we use it to represent the download uri path.
>
> Signed-off-by: Mark Wu <wudxw at linux.vnet.ibm.com>
> ---
>   docs/API.md                        | 2 +-
>   src/kimchi/control/debugreports.py | 2 +-
>   src/kimchi/model/debugreports.py   | 2 +-
>   ui/css/theme-default/host.css      | 4 ----
>   ui/js/src/kimchi.host.js           | 4 ----
>   ui/pages/i18n.html.tmpl            | 1 -
>   6 files changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/docs/API.md b/docs/API.md
> index 672ef14..105498a 100644
> --- a/docs/API.md
> +++ b/docs/API.md
> @@ -672,7 +672,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
> +    * uri: The URI path to download a 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..6efae23 100644
> --- a/src/kimchi/control/debugreports.py
> +++ b/src/kimchi/control/debugreports.py
> @@ -37,7 +37,7 @@ class DebugReport(Resource):
>       @property
>       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..6ae282a 100644
> --- a/src/kimchi/model/debugreports.py
> +++ b/src/kimchi/model/debugreports.py
> @@ -162,7 +162,7 @@ class DebugReportModel(object):
>           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,
> +        return {'uri': file_target,
>                   'ctime': ctime}
>
>       def delete(self, name):
> diff --git a/ui/css/theme-default/host.css b/ui/css/theme-default/host.css
> index 0f8b941..8af34f5 100644
> --- a/ui/css/theme-default/host.css
> +++ b/ui/css/theme-default/host.css
> @@ -215,14 +215,10 @@
>   }
>
>   .debug-report-name,
> -.debug-report-file,
>   .debug-report-time {
>       width: 200px;
>   }
>
> -.debug-report-file {
> -    width: 300px;
> -}
>   /* End of Debug Report */
>
>   /* Software Updates */
> diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
> index 6300f37..fa7b4c8 100644
> --- a/ui/js/src/kimchi.host.js
> +++ b/ui/js/src/kimchi.host.js
> @@ -186,10 +186,6 @@ kimchi.host_main = function() {
>                   label: i18n['KCHDR6003M'],
>                   'class': 'debug-report-name'
>               }, {
> -                name: 'file',
> -                label: i18n['KCHDR6004M'],
> -                'class': 'debug-report-file'
> -            }, {
>                   name: 'time',
>                   label: i18n['KCHDR6005M'],
>                   'class': 'debug-report-time'
> diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
> index 2f47e50..a626759 100644
> --- a/ui/pages/i18n.html.tmpl
> +++ b/ui/pages/i18n.html.tmpl
> @@ -92,7 +92,6 @@ var i18n = {
>       'KCHDR6001M': "$_("Debug report will be removed permanently and can't be recovered. Do you want to continue?")",
>       'KCHDR6002M': "$_("Debug Reports")",
>       'KCHDR6003M': "$_("Name")",
> -    'KCHDR6004M': "$_("File Path")",
>       'KCHDR6005M': "$_("Generated Time")",
>       'KCHDR6006M': "$_("Generate")",
>       'KCHDR6007M': "$_("Generating...")",




More information about the Kimchi-devel mailing list