[Kimchi-devel] [PATCH 2/2] Fix debug report naming problem (UI)

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Fri Feb 21 15:29:58 UTC 2014


The tool sosreport only accepts letters, digits and hyphen in the name
of the report, non alphanumeric characteres are removed from the file
name and then Kimchi is not able to find the file.

This patch modifies the UI html and js in order to show the right
information and catch the right return error message.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.report_add_main.js | 9 +++++++--
 ui/pages/report-add.html.tmpl       | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ui/js/src/kimchi.report_add_main.js b/ui/js/src/kimchi.report_add_main.js
index f893d85..96d9625 100644
--- a/ui/js/src/kimchi.report_add_main.js
+++ b/ui/js/src/kimchi.report_add_main.js
@@ -25,8 +25,13 @@ kimchi.report_add_main = function() {
                 result: result
             });
         }, function(result) {
-            result && result['reason'] &&
-                $('#report-error-message').text(result['reason']);
+            if (result['reason']) {
+                var errText = result['reason'];
+            }
+            else {
+                var errText = result['responseJSON']['reason'];
+            }
+            result && $('#report-error-message').text(errText);
             submitButton
                 .text(i18n['KCHDR6006M'])
                 .prop('disabled', false);
diff --git a/ui/pages/report-add.html.tmpl b/ui/pages/report-add.html.tmpl
index 2a962d4..383175f 100644
--- a/ui/pages/report-add.html.tmpl
+++ b/ui/pages/report-add.html.tmpl
@@ -38,7 +38,7 @@
                 </h2>
                 <div class="field">
                     <span>
-                        $_("The name used to identify the report. If omitted, a name will be chosen based on current time. Name can contain: letters, digits, \"-\", \"_\", or \".\".")
+                        $_("The name used to identify the report. If omitted, a name will be chosen based on current time. Name can contain: letters, digits and hyphen (\"-\").")
                     </span>
                     <input type="text" class="text" id="report-name-textbox" name="name" />
                     <span id="report-error-message"></span>
-- 
1.8.5.3




More information about the Kimchi-devel mailing list