[PATCH] Add help to user menu
by Adam King
Add a link to the help to the Kimchi user menu.
Include text for the word "Help" in the translation files.
The implementation assumes that the help file name matches the tab hash id, and does a simple mapping from one to the other.
Signed-off-by: Adam King <rak(a)linux.vnet.ibm.com>
---
po/en_US.po | 3 +++
po/kimchi.pot | 3 +++
po/pt_BR.po | 3 +++
po/zh_CN.po | 3 +++
ui/css/theme-default/topbar.css | 3 ++-
ui/js/src/kimchi.main.js | 18 ++++++++++++++++++
ui/pages/kimchi-ui.html.tmpl | 5 ++++-
7 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/po/en_US.po b/po/en_US.po
index 8ac59c7..d68d8a4 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -304,6 +304,9 @@ msgstr "This is not a valid Server Name or IP. please, modify it."
msgid "Log out"
msgstr "Log out"
+msgid "Help"
+msgstr ""
+
msgid "Log In"
msgstr "Log In"
diff --git a/po/kimchi.pot b/po/kimchi.pot
index f7b33ee..1a748ce 100755
--- a/po/kimchi.pot
+++ b/po/kimchi.pot
@@ -296,6 +296,9 @@ msgstr ""
msgid "Log out"
msgstr ""
+msgid "Help"
+msgstr ""
+
msgid "Log In"
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 0d924e3..7e521e6 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -322,6 +322,9 @@ msgstr ""
msgid "Log out"
msgstr "Sair"
+msgid "Help"
+msgstr ""
+
msgid "Log In"
msgstr "Entrar"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 361c11a..5cc93cd 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -312,6 +312,9 @@ msgstr "这不是一个有效的服务器名或IP,请修改"
msgid "Log out"
msgstr "登出"
+msgid "Help"
+msgstr ""
+
msgid "Log In"
msgstr "登录"
diff --git a/ui/css/theme-default/topbar.css b/ui/css/theme-default/topbar.css
index c273c70..1988a6e 100644
--- a/ui/css/theme-default/topbar.css
+++ b/ui/css/theme-default/topbar.css
@@ -160,11 +160,12 @@
white-space: nowrap;
}
-#btn-logout {
+.user-menu-item {
color: black;
font-size: 14px;
}
+
a#btn-logout:hover {
text-decoration: underline;
}
diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js
index 5387495..960c27b 100644
--- a/ui/js/src/kimchi.main.js
+++ b/ui/js/src/kimchi.main.js
@@ -135,6 +135,8 @@ kimchi.main = function() {
});
// Perform logging out via Ajax request.
+
+
$('#btn-logout').on('click', function() {
kimchi.logout(function() {
updatePage();
@@ -142,6 +144,8 @@ kimchi.main = function() {
kimchi.message.error(err.responseJSON.reason);
});
});
+
+ $('#btn-help').on('click', kimchi.getHelp);
};
// Load i18n translation strings first and then render the page.
@@ -219,3 +223,17 @@ kimchi.getTabHtml = function(url) {
});
return tabsHtml;
};
+
+kimchi.getHelp = function(e) {
+ var url=window.location.hash;
+ url = url.replace("#tabs","/help");
+ if (url == "/help")
+ url=url+"/index.html"
+ else
+ url=url+".html";
+
+ $(this).closest('.popable').click();
+ window.open(url, "Kimchi Help");
+ e.preventDefault();
+ e.stopPropagation();
+};
diff --git a/ui/pages/kimchi-ui.html.tmpl b/ui/pages/kimchi-ui.html.tmpl
index eebe886..24e0372 100644
--- a/ui/pages/kimchi-ui.html.tmpl
+++ b/ui/pages/kimchi-ui.html.tmpl
@@ -78,7 +78,10 @@
<span id="user-name"></span>
<span class="arrow"></span>
<div class="action-panel popover right-side">
- <a id="btn-logout" href="javascript: void(0);">$_("Log out")</a>
+ <a id="btn-help" class="user-menu-item" href="javascript:void(0);">$_("Help")</a>
+ <br/>
+ <hr/>
+ <a id="btn-logout" class="user-menu-item" href="javascript: void(0);">$_("Log out")</a>
</div>
</div>
</li>
--
1.8.1.4
10 years, 10 months
[PATCH V3 0/2] Fix debug report naming error
by Rodrigo Trujillo
V3
- Fix error in message code
- Adds strip() when get report name, avoiding extra spaces in the name
V2
Implement enhancements proposed by Aline in code review:
- UI does validation in the report name
- Automatic name is generated in backend now
- Name not required. User can send empty string or none
V1
The two patch fix a problem reported by internal test team.
Rodrigo Trujillo (2):
Fix debug report naming problem (backend)
Fix debug report naming problem (UI)
src/kimchi/API.json | 12 ++++++++++++
src/kimchi/control/base.py | 1 +
src/kimchi/i18n.py | 2 ++
src/kimchi/model/debugreports.py | 5 ++++-
ui/js/src/kimchi.report_add_main.js | 21 +++++++++++++--------
ui/pages/i18n.html.tmpl | 2 +-
ui/pages/report-add.html.tmpl | 2 +-
7 files changed, 34 insertions(+), 11 deletions(-)
--
1.8.5.3
10 years, 10 months
[PATCH V4 1/2] Fix debug report naming problem (backend)
by Rodrigo Trujillo
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 fixes the problem in the backend, adding json schema
verification.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/API.json | 12 ++++++++++++
src/kimchi/control/base.py | 1 +
src/kimchi/i18n.py | 2 ++
src/kimchi/model/debugreports.py | 5 ++++-
4 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index 1189c01..f595bbf 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -29,6 +29,18 @@
}
},
"properties": {
+ "debugreports_create": {
+ "type": "object",
+ "error": "KCHDR0006E",
+ "properties": {
+ "name": {
+ "description": "The name for the debug report file.",
+ "type": "string",
+ "pattern": "^[A-Za-z0-9-]*$",
+ "error": "KCHDR0007E"
+ }
+ }
+ },
"storagepools_create": {
"type": "object",
"error": "KCHPOOL0026E",
diff --git a/src/kimchi/control/base.py b/src/kimchi/control/base.py
index 50f8c43..91a70ae 100644
--- a/src/kimchi/control/base.py
+++ b/src/kimchi/control/base.py
@@ -308,6 +308,7 @@ class AsyncCollection(Collection):
get_class_name(self)})
raise cherrypy.HTTPError(405, e.message)
+ validate_params(params, self, 'create')
args = self.model_args + [params]
task = create(*args)
cherrypy.response.status = 202
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index fc4b1ff..fea0184 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -174,6 +174,8 @@ messages = {
"KCHDR0003E": _("Unable to create debug report %(name)s. Details: %(err)s."),
"KCHDR0004E": _("Can not find any generated debug report matching name %(name)s"),
"KCHDR0005E": _("Unable to generate debug report %(name)s. Details: %(err)s"),
+ "KCHDR0006E": _("You should give a name for the debug file report."),
+ "KCHDR0007E": _("Name should be a string. Only letters, digits and hyphen ('-') are allowed."),
"KCHSR0001E": _("Storage server %(server)s was not used by Kimchi"),
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py
index 7dbd69f..7573a5b 100644
--- a/src/kimchi/model/debugreports.py
+++ b/src/kimchi/model/debugreports.py
@@ -41,7 +41,10 @@ class DebugReportsModel(object):
self.task = TaskModel(**kargs)
def create(self, params):
- ident = params['name']
+ ident = params.get('name').strip()
+ # Generate a name with time and millisec precision, if necessary
+ if ident is None or ident == "":
+ ident = 'report-' + str(int(time.time()*1000))
taskid = self._gen_debugreport_file(ident)
return self.task.lookup(taskid)
--
1.8.5.3
10 years, 10 months
[PATCH] Github bug #326: run_command
by Daniel Barboza
From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
As described in https://github.com/kimchi-project/kimchi/issues/326,
run_command does not handle blocking process with timeout.
This patch fixes the bug, killing all children process of the process
created by Popen() call before executing kill() in the parent
process, making the timeout timer working as intended.
Please refer to the commit message of the patch for further details.
Using the same example described in the github bug entry to
demonstrate the fix:
$ sudo PYTHONPATH=src python
Python 2.7.5 (default, Nov 12 2013, 16:18:42)
[GCC 4.8.2 20131017 (Red Hat 4.8.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from kimchi.utils import run_command
>>> mount = ['mount', 'localhost:/var/nfs', '/home/danielhb/nfs_test/']
>>> run_command(mount, 7)
subprocess is killed by signal.SIGKILL for timeout 7 seconds
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/danielhb/kimchi/kimchi-upstream/src/kimchi/utils.py", line 181, in run_command
raise TimeoutExpired("KCHUTILS0002E", msg_args)
kimchi.exception.TimeoutExpired: KCHUTILS0002E: Timeout while running command '['mount', 'localhost:/var/nfs', '/home/danielhb/nfs_test/']' after 7 seconds
ps output:
---- right after run_command started ----
[danielhb@tirion ~]$ ps axf | grep mount
16664 pts/3 S+ 0:00 | | \_ grep --color=auto mount
16660 pts/4 S+ 0:00 | \_ mount localhost:/var/nfs /home/danielhb/nfs_test/
16662 pts/4 D+ 0:00 | \_ /sbin/mount.nfs localhost:/var/nfs /home/danielhb/nfs_test -o rw
[danielhb@tirion ~]$
---- after the timeout of 7 seconds ----
[danielhb@tirion ~]$ ps axf | grep mount
16696 pts/3 S+ 0:00 | | \_ grep --color=auto mount
*** BLURB HERE ***
Daniel Henrique Barboza (1):
Github bug #326: run_command: killing all children processes
src/kimchi/utils.py | 9 +++++++++
1 file changed, 9 insertions(+)
--
1.8.3.1
10 years, 10 months
[PATCH V2 0/2] Fix debug report naming error
by Rodrigo Trujillo
V2
Implement enhancements proposed by Aline in code review:
- UI does validation in the report name
- Automatic name is generated in backend now
- Name not required. User can send empty string or none
V1
The two patch fix a problem reported by internal test team.
Rodrigo Trujillo (2):
Fix debug report naming problem (backend)
Fix debug report naming problem (UI)
src/kimchi/API.json | 12 ++++++++++++
src/kimchi/control/base.py | 1 +
src/kimchi/i18n.py | 2 ++
src/kimchi/model/debugreports.py | 5 ++++-
ui/js/src/kimchi.report_add_main.js | 21 +++++++++++++--------
ui/pages/i18n.html.tmpl | 2 +-
ui/pages/report-add.html.tmpl | 2 +-
7 files changed, 34 insertions(+), 11 deletions(-)
--
1.8.5.3
10 years, 10 months
[PATCH v2] UI: Host Software Update Support
by Hongliang Wang
Added UI support for software updating. The Host Tab will initially
list available updates to user if there are any; or we will disable
"Update All" Button if no updates available.
V1 -> V2:
2a) Fixed "Update All" Button always being disabled issue
(Thanks to Paulo Ricardo Paz Vital's comment)
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/host.css | 22 +++++++++++++++
ui/js/src/kimchi.api.js | 52 ++++++++++++++++++++++++++++++++++
ui/js/src/kimchi.host.js | 65 +++++++++++++++++++++++++++++++++++++++++++
ui/pages/i18n.html.tmpl | 9 ++++++
ui/pages/tabs/host.html.tmpl | 13 +++++++++
5 files changed, 161 insertions(+)
diff --git a/ui/css/theme-default/host.css b/ui/css/theme-default/host.css
index 67daeaf..1342ade 100644
--- a/ui/css/theme-default/host.css
+++ b/ui/css/theme-default/host.css
@@ -227,3 +227,25 @@
width: 300px;
}
/* End of Debug Report */
+
+/* Software Updates */
+.host-panel #software-updates-grid {
+ border-color: #ddd;
+ height: 300px;
+ width: 850px;
+}
+
+.software-update-id {
+ width: 30px;
+}
+
+.software-update-name,
+.software-update-repos {
+ width: 220px;
+}
+
+.software-update-version,
+.software-update-arch {
+ width: 190px;
+}
+/* End of Software Updates */
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 6433fe0..c3a9516 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -731,5 +731,57 @@ var kimchi = {
success : suc,
error : err
});
+ },
+
+ listSoftwareUpdates : function(suc, err) {
+ kimchi.requestJSON({
+ url : kimchi.url + 'host/packagesupdate',
+ type : 'GET',
+ contentType : 'application/json',
+ dataType : 'json',
+ resend: true,
+ success : suc,
+ error : err
+ });
+ },
+
+ updateSoftwares : function(suc, err) {
+ var taskID = -1;
+ var onResponse = function(data) {
+ taskID = data['id'];
+ trackTask();
+ };
+
+ var trackTask = function() {
+ kimchi.getTask(taskID, onTaskResponse, err);
+ };
+
+ var onTaskResponse = function(result) {
+ var taskStatus = result['status'];
+ switch(taskStatus) {
+ case 'running':
+ setTimeout(function() {
+ trackTask();
+ }, 200);
+ break;
+ case 'finished':
+ suc(result);
+ break;
+ case 'failed':
+ err(result);
+ break;
+ default:
+ break;
+ }
+ };
+
+ kimchi.requestJSON({
+ url : kimchi.url + 'host/packagesupdate/update',
+ type : "POST",
+ contentType : "application/json",
+ dataType : "json",
+ success : onResponse,
+ error : err
+ });
}
};
diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
index a5c341b..b6a5878 100644
--- a/ui/js/src/kimchi.host.js
+++ b/ui/js/src/kimchi.host.js
@@ -131,6 +131,69 @@ kimchi.host_main = function() {
});
};
+ var softwareUpdatesGridID = 'software-updates-grid';
+ var softwareUpdatesGrid = null;
+ var initSoftwareUpdatesGrid = function(softwareUpdates) {
+ softwareUpdatesGrid = new kimchi.widget.Grid({
+ container: 'software-updates-grid-container',
+ id: softwareUpdatesGridID,
+ title: i18n['KCHUPD6001M'],
+ toolbarButtons: [{
+ id: softwareUpdatesGridID + '-update-button',
+ label: i18n['KCHUPD6006M'],
+ disabled: true,
+ onClick: function(event) {
+ var updateButton = $(this);
+ $(updateButton).text(i18n['KCHUPD6007M']).prop('disabled', true);
+ kimchi.updateSoftwares(function(result) {
+ $(updateButton).text(i18n['KCHUPD6006M']).prop('disabled', false);
+ });
+ }
+ }],
+ frozenFields: [{
+ name: 'id',
+ label: ' ',
+ 'class': 'software-update-id'
+ }],
+ fields: [{
+ name: 'package_name',
+ label: i18n['KCHUPD6002M'],
+ 'class': 'software-update-name'
+ }, {
+ name: 'version',
+ label: i18n['KCHUPD6003M'],
+ 'class': 'software-update-version'
+ }, {
+ name: 'arch',
+ label: i18n['KCHUPD6004M'],
+ 'class': 'software-update-arch'
+ }, {
+ name: 'repository',
+ label: i18n['KCHUPD6005M'],
+ 'class': 'software-update-repos'
+ }],
+ data: softwareUpdates
+ });
+ };
+
+ var listSoftwareUpdates = function() {
+ kimchi.listSoftwareUpdates(function(softwareUpdates) {
+ $.each(softwareUpdates, function(i, item) {
+ softwareUpdates[i]['id'] = i + 1;
+ });
+
+ if(softwareUpdatesGrid) {
+ softwareUpdatesGrid.setData(softwareUpdates);
+ }
+ else {
+ initSoftwareUpdatesGrid(softwareUpdates);
+ }
+
+ $(softwareUpdatesGridID + '-update-button')
+ .prop('disabled', softwareUpdates.length === 0);
+ });
+ };
+
var shutdownButtonID = '#host-button-shutdown';
var restartButtonID = '#host-button-restart';
var shutdownHost = function(params) {
@@ -189,6 +252,8 @@ kimchi.host_main = function() {
kimchi.keepMonitoringHost = this['checked'];
});
+ listSoftwareUpdates();
+
kimchi.getCapabilities(function(capabilities) {
if(!capabilities['system_report_tool']) {
return;
diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
index 098a0a9..a9d86b3 100644
--- a/ui/pages/i18n.html.tmpl
+++ b/ui/pages/i18n.html.tmpl
@@ -94,6 +94,15 @@ var i18n = {
'KCHDR6010M': "$_("Download")",
+ 'KCHUPD6001M': "$_("Software Updates")",
+ 'KCHUPD6002M': "$_("Package Name")",
+ 'KCHUPD6003M': "$_("Version")",
+ 'KCHUPD6004M': "$_("Architecture")",
+ 'KCHUPD6005M': "$_("Repository")",
+ 'KCHUPD6006M': "$_("Update All")",
+ 'KCHUPD6007M': "$_("Updating...")",
+
+
'KCHVM6001M': "$_("This will delete the virtual machine and its virtual disks. This operation cannot be undone. Would you like to continue?")",
'KCHNET6001E': "$_("The VLAN id must be between 1 and 4094.")",
diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl
index d32773a..1de4fcd 100644
--- a/ui/pages/tabs/host.html.tmpl
+++ b/ui/pages/tabs/host.html.tmpl
@@ -123,6 +123,19 @@
</div>
</div>
</div>
+ <div id="software-update-section" class="host-section">
+ <h3 class="section-header"
+ aria-controls="content-software-update">
+ $_("Software Updates")
+ </h3>
+ <div id="content-software-update" class="section-content">
+ <div class="section-row">
+ <div class="section-value">
+ <div id="software-updates-grid-container"></div>
+ </div>
+ </div>
+ </div>
+ </div>
<div id="debug-report-section" class="host-section hidden">
<h3 class="section-header"
aria-controls="content-sys-reports">
--
1.8.1.4
10 years, 10 months
[PATCH 1/2] Issue #243: start/stop/display a VM whose name with "?"
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
create a VM with name ubuntu?guest4
start/stop/display this VM
Kimchi will throw a exception:
"Unexpected query string parameters: guest4"
That's because the URL is not quoted when internal_redirect.
Also unquote the ident before dispatch the resource.
issue:
https://github.com/kimchi-project/kimchi/issues/243
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
src/kimchi/control/base.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/control/base.py b/src/kimchi/control/base.py
index 048dd34..50f8c43 100644
--- a/src/kimchi/control/base.py
+++ b/src/kimchi/control/base.py
@@ -54,7 +54,6 @@ class Resource(object):
"""
def __init__(self, model, ident=None):
self.model = model
- ident = ident if ident is None else urllib2.unquote(ident)
self.ident = ident
self.model_args = (ident,)
self.update_params = []
@@ -76,7 +75,8 @@ class Resource(object):
fn = getattr(self.model, model_fn(self, action_name))
ident = fn(*model_args)
self._redirect(ident)
- uri_params = tuple(self.model_args)
+ uri_params = tuple([urllib2.quote(arg.encode('utf-8'), safe="")
+ for arg in self.model_args])
raise internal_redirect(self.uri_fmt % uri_params)
except MissingParameter, e:
raise cherrypy.HTTPError(400, e.message)
@@ -238,6 +238,7 @@ class Collection(object):
def _cp_dispatch(self, vpath):
if vpath:
ident = vpath.pop(0)
+ ident = urllib2.unquote(ident)
# incoming text, from URL, is not unicode, need decode
args = self.resource_args + [ident.decode("utf-8")]
return self.resource(self.model, *args)
--
1.8.4.2
10 years, 10 months
[PATCH] Clear unused reference in vmstorages of 'kargs'
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Unused attribute in VMStorageModel 'kargs', delete it.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/model/vmstorages.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
index c715b43..7796f30 100644
--- a/src/kimchi/model/vmstorages.py
+++ b/src/kimchi/model/vmstorages.py
@@ -150,7 +150,6 @@ class VMStoragesModel(object):
class VMStorageModel(object):
def __init__(self, **kargs):
self.conn = kargs['conn']
- self.kargs = kargs
def _get_device_xml(self, vm_name, dev_name):
# Get VM xml and then devices xml
--
1.8.1.2
10 years, 10 months
[PATCH] bug fix: add rhel workstation to YUM_DISTROS
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
red hat enterprise linux workstation also use yum to manage package.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/repositories.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/kimchi/repositories.py b/src/kimchi/repositories.py
index 0ab0b1a..40ce266 100644
--- a/src/kimchi/repositories.py
+++ b/src/kimchi/repositories.py
@@ -28,6 +28,7 @@ from kimchi.exception import InvalidOperation, InvalidParameter
from kimchi.exception import OperationFailed, NotFoundError, MissingParameter
YUM_DISTROS = ['fedora', 'red hat enterprise linux',
+ 'red hat enterprise linux workstation',
'red hat enterprise linux server', 'opensuse ',
'suse linux enterprise server ']
APT_DISTROS = ['debian', 'ubuntu']
--
1.8.4.2
10 years, 10 months
[PATCH] Issue #320: give friendly prompt when kimchid fails to run with non-root user
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
If a non-root/non-sudo user tries to run kimchid, it fails with the
verbose stacktrace.
This is not friendly to user.
There should be a check for these cases, allowing kimchid to fail
gracefully.
Issue:
https://github.com/kimchi-project/kimchi/issues/320
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/server.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/server.py b/src/kimchi/server.py
index 6dd0404..f93b6ee 100644
--- a/src/kimchi/server.py
+++ b/src/kimchi/server.py
@@ -158,8 +158,13 @@ class Server(object):
pass
cherrypy.log.screen = True
- cherrypy.log.access_file = options.access_log
- cherrypy.log.error_file = options.error_log
+ try:
+ cherrypy.log.access_file = options.access_log
+ cherrypy.log.error_file = options.error_log
+ except IOError as e:
+ print e
+ print "Please run kimchi with root user"
+ exit()
logLevel = LOGGING_LEVEL.get(options.log_level, logging.DEBUG)
dev_env = options.environment != 'production'
--
1.8.4.2
10 years, 10 months