easy install
by Nicolas Naud
Hello, I'm small administrator (rrot) for linux. It's possible easy
installe for kimchi, I win a later 4 week for installing kimchi.
thanks you
--
Nicolas Naud
Technicien informatique
SFA - Administration générale - Service Informatique Général
TSA 51106
9, Rue C C Chenou Bât B5
86073 POITIERS POITIERS CEDEX 9
Tél : +33 5 49 45 38 16
Port : 06.19.13.20.59
Courriel : nicolas.naud(a)univ-poitiers.fr
8 years, 8 months
Wok 2.1 is released!
by Aline Manera
On behalf of everyone who has worked hard on this release, I am pleased
to announce the availability of *Wok 2.1*!
Among many features, Wok 2.1 includes:
✔ New Wok logo
✔ Plugins logo support
✔ User activity log support
✔ Allow user disable HTTP port
✔ Proxy websocket connections on nginx
✔ Rotate Wok logs
✔ Ensure plugins tab order
✔ Add multiple libraries to support new widgets
✔ Bootgrid plugin
✔ X-editable plugin
✔ Bootstrap Switch plugin
✔ Typeahead library
✔ JQuery ContainsNC library
✔ Bug fixes
We have worked hard to ensure that Wok runs well on the most popular
Linux distributions including: Fedora 23, Ubuntu 15.10, openSUSE LEAP 42.1,
and RHEL 7.2. Wok uses standard Linux interfaces so it should run well
on many other distributions too.
You can easily grab this release in tarball format or via git:
✔https://github.com/kimchi-project/wok/archive/2.1.0.tar.gz
✔ git clone --recursivehttps://github.com/kimchi-project/wok.git
There are also some packages available at:
✔http://kimchi-project.github.io/wok/downloads/
Go ahead! Give it a try and let us know what you think!
Regards,
Aline Manera
8 years, 8 months
Re: [Kimchi-devel] [ginger-dev-list] [PATCH] [Ginger 4/4] Added support for UTF-8 encoding in user management.
by Archana Singh
Hi,
Please find my comment below. Adding kimchi dev mailing and Aline as
changes are suggested in wok util.
Thanks,
Archana Singh
On 3/23/2016 12:33 PM, Daniel Henrique Barboza wrote:
>
>
> On 03/23/2016 02:24 PM, Archana Singh wrote:
>>
>>
>> On 3/23/2016 12:19 PM, Abhiram wrote:
>>> On Wed, 2016-03-23 at 11:39 -0500, Archana Singh wrote:
>>>> Hi Suresh,
>>>>
>>>> As all of these methods are not private methods, I will suggest to
>>>> have
>>>> check in all the methods.
>>> Eventhough the methods arent private, the initial caller has to be
>>> create,getlist,delete,lookup atleast as suresh mentioned from ui point.
>>> I feel it has to be one place, rather than having in all sub methods
>>> which is redundant in nature.
>>>
>>> If we want to have all places, do we want to have the unicode checking
>>> and conversion into one common method and reuse the same everywhere? If
>>> at all we have any change in future probably only one method we can
>>> modify.
>>
>> I do understand the redundant point of view, but as these are not
>> private methods can be called from any place.
>
> If it's a widespread issue then can we look at WoK engine code to fix
> it for all cases and
> plug-ins?
>
> I don't know if this is actually viable but at first it makes sense to
> me. Would need
> some investigation.
>
>
> Daniel
Hi Daniel,
Are you pointing to have common wok util method for checking isinstance
of unicode and encoding to utf-8?
@Aline: Adding kimchi dev list and you to discuss this further as change
is suggested in wok. Please provide you input.
Thanks,
Archana Singh
>
>> As we do not have type check for the parameter in the method, it is
>> safe to ensure that we do not end up in some encoding issue.
>>
>>>> Thanks,
>>>> Archana Singh
>>>>
>>>> On 3/23/2016 2:05 AM, Suresh Babu Angadi wrote:
>>>>> Hi Archana,
>>>>> Instead of checking unicode in every method, can we have it only in
>>>>> UsersModel and UserModel - create, getlist, delete, lookup?
>>>>>
>>>>> On 03/22/2016 03:52 AM, archus(a)linux.vnet.ibm.com wrote:
>>>>>> From: Archana Singh <archus(a)linux.vnet.ibm.com>
>>>>>>
>>>>>> ---
>>>>>> i18n.py | 3 ++-
>>>>>> model/users.py | 69
>>>>>> ++++++++++++++++++++++++++++++++++++++++++++++++----------
>>>>>> 2 files changed, 59 insertions(+), 13 deletions(-)
>>>>>>
>>>>>> diff --git a/i18n.py b/i18n.py
>>>>>> index 78260a0..6729bf3 100644
>>>>>> --- a/i18n.py
>>>>>> +++ b/i18n.py
>>>>>> @@ -124,10 +124,11 @@ messages = {
>>>>>> "GINUSER0006E": _("Could not add user '%(user)s' to kvm
>>>>>> group."),
>>>>>> "GINUSER0007E": _("Could not add user '%(user)s' to sudoers
>>>>>> list."),
>>>>>> "GINUSER0008E": _("The user name '%(user)s' is already in
>>>>>> use'."),
>>>>>> - "GINUSER0009E": _("Could not create user '%(user)s'."),
>>>>>> + "GINUSER0009E": _("Could not create user '%(user)s', error:
>>>>>> %(err)s'."),
>>>>>> "GINUSER0010E": _("Could not delete user '%(user)s'."),
>>>>>> "GINUSER0011E": _("User '%(user)s' does not exist."),
>>>>>> "GINUSER0012E": _("Could not delete group '%(group)s'"),
>>>>>> + "GINUSER0013E": _("Could not create group name'%(group)s',
>>>>>> error: %(err)s'."),
>>>>>>
>>>>>> "GINFW0001E": _("Cannot update system firmware while running
>>>>>> VMs."),
>>>>>> "GINFW0002E": _("Firmware image unpack failed: rc = %(rc)s. "
>>>>>> diff --git a/model/users.py b/model/users.py
>>>>>> index a05bd5f..f8f450d 100644
>>>>>> --- a/model/users.py
>>>>>> +++ b/model/users.py
>>>>>> @@ -1,3 +1,4 @@
>>>>>> +# -*- coding: utf-8 -*-
>>>>>> #
>>>>>> # Project Ginger
>>>>>> #
>>>>>> @@ -51,6 +52,8 @@ def get_group_obj_by_gid(gid):
>>>>>>
>>>>>> def get_group_gid(groupname):
>>>>>> adm = libuser.admin()
>>>>>> + if isinstance(groupname, unicode):
>>>>>> + groupname = groupname.encode('utf-8')
>>>>>> group = adm.lookupGroupByName(groupname)
>>>>>> if group is None:
>>>>>> return None
>>>>>> @@ -58,19 +61,30 @@ def get_group_gid(groupname):
>>>>>>
>>>>>>
>>>>>> def create_group(groupname, gid):
>>>>>> - adm = libuser.admin()
>>>>>> - group = adm.lookupGroupByName(groupname)
>>>>>> - if not group:
>>>>>> - new_group = adm.initGroup(groupname)
>>>>>> - new_group.set(libuser.GIDNUMBER, gid)
>>>>>> - adm.addGroup(new_group)
>>>>>> - return gid
>>>>>> - else:
>>>>>> - return group.get('pw_gid')[0]
>>>>>> + try:
>>>>>> + adm = libuser.admin()
>>>>>> + if isinstance(groupname, unicode):
>>>>>> + groupname = groupname.encode('utf-8')
>>>>>> + if isinstance(gid, unicode):
>>>>>> + gid = gid.encode('utf-8')
>>>>>> + group = adm.lookupGroupByName(groupname)
>>>>>> + if not group:
>>>>>> + new_group = adm.initGroup(groupname)
>>>>>> + new_group.set(libuser.GIDNUMBER, gid)
>>>>>> + adm.addGroup(new_group)
>>>>>> + return gid
>>>>>> + else:
>>>>>> + return group.get('pw_gid')[0]
>>>>>> + except Exception as e:
>>>>>> + wok_log.error('Could not create group name %s, error: %s',
>>>>>> + groupname, e)
>>>>>> + raise OperationFailed('GINUSER0013E', {'group': groupname,
>>>>>> 'err': e})
>>>>>>
>>>>>>
>>>>>> def delete_group(groupname):
>>>>>> adm = libuser.admin()
>>>>>> + if isinstance(groupname, unicode):
>>>>>> + groupname = groupname.encode('utf-8')
>>>>>> group_obj = adm.lookupGroupById(
>>>>>> int(get_group_gid(groupname))
>>>>>> )
>>>>>> @@ -89,6 +103,8 @@ def delete_group(groupname):
>>>>>>
>>>>>> def get_users_from_group(groupname):
>>>>>> adm = libuser.admin()
>>>>>> + if isinstance(groupname, unicode):
>>>>>> + groupname = groupname.encode('utf-8')
>>>>>> group_obj = adm.lookupGroupById(
>>>>>> int(get_group_gid(groupname))
>>>>>> )
>>>>>> @@ -108,6 +124,8 @@ def get_users(exclude_system_users=True):
>>>>>>
>>>>>> def get_user_obj(username):
>>>>>> adm = libuser.admin()
>>>>>> + if isinstance(username, unicode):
>>>>>> + username = username.encode('utf-8')
>>>>>> return adm.lookupUserByName(username)
>>>>>>
>>>>>>
>>>>>> @@ -120,6 +138,10 @@ def gen_salt():
>>>>>>
>>>>>> def create_user(name, plain_passwd, profile=None, gid=None):
>>>>>> adm = libuser.admin()
>>>>>> + if isinstance(name, unicode):
>>>>>> + name = name.encode('utf-8')
>>>>>> + if isinstance(gid, unicode):
>>>>>> + gid = gid.encode('utf-8')
>>>>>> user = adm.lookupUserByName(name)
>>>>>> if user:
>>>>>> msg = 'User/Login "%s" already in use' % name
>>>>>> @@ -150,15 +172,23 @@ def create_user(name, plain_passwd,
>>>>>> profile=None, gid=None):
>>>>>> enc_pwd = crypt.crypt(plain_passwd, salt)
>>>>>>
>>>>>> adm.setpassUser(new_user, enc_pwd, True)
>>>>>> + except UnicodeEncodeError as ue:
>>>>>> + err_msg = ue.message if ue.message else 'Username /
>>>>>> password \
>>>>>> + has NON - ASCII charater'
>>>>>> + wok_log.error('Could not create user %s, error: %s', name,
>>>>>> err_msg)
>>>>>> + raise OperationFailed('GINUSER0009E', {'user': name, 'err':
>>>>>> err_msg})
>>>>>> except Exception as e:
>>>>>> - wok_log.error('Could not create user %s, error: %s',
>>>>>> name, e)
>>>>>> - raise OperationFailed('GINUSER0009E', {'user': name})
>>>>>> + err_msg = e.message if e.message else e
>>>>>> + wok_log.error('Could not create user %s, error: %s', name,
>>>>>> err_msg)
>>>>>> + raise OperationFailed('GINUSER0009E', {'user': name, 'err':
>>>>>> err_msg})
>>>>>>
>>>>>> return new_user
>>>>>>
>>>>>>
>>>>>> def delete_user(username):
>>>>>> adm = libuser.admin()
>>>>>> + if isinstance(username, unicode):
>>>>>> + username = username.encode('utf-8')
>>>>>> user_obj = adm.lookupUserByName(username)
>>>>>>
>>>>>> if user_obj is None:
>>>>>> @@ -182,6 +212,11 @@ class UsersModel(object):
>>>>>> profile = params['profile']
>>>>>> groupname = params['group']
>>>>>>
>>>>>> + if isinstance(username, unicode):
>>>>>> + username = username.encode('utf-8')
>>>>>> + if isinstance(groupname, unicode):
>>>>>> + groupname = groupname.encode('utf-8')
>>>>>> +
>>>>>> gid = get_group_gid(groupname)
>>>>>> if gid is None:
>>>>>> user = create_user(username, passwd, profile=profile)
>>>>>> @@ -213,6 +248,8 @@ class UsersModel(object):
>>>>>> # Add new user to KVM group
>>>>>> adm = libuser.admin()
>>>>>> kvmgrp = get_group_obj('kvm')
>>>>>> + if isinstance(user, unicode):
>>>>>> + user = user.encode('utf-8')
>>>>>> kvmgrp.add('gr_mem', user)
>>>>>> ret = adm.modifyGroup(kvmgrp)
>>>>>> if ret != 1:
>>>>>> @@ -227,6 +264,7 @@ class UsersModel(object):
>>>>>>
>>>>>>
>>>>>> class UserModel(object):
>>>>>> +
>>>>>> def delete(self, user):
>>>>>> user_obj = get_user_obj(user)
>>>>>> group_obj = get_group_obj_by_gid(
>>>>>> @@ -252,7 +290,10 @@ class UserModel(object):
>>>>>> group_name = grp.getgrgid(user_info.pw_gid).gr_name
>>>>>>
>>>>>> except KeyError:
>>>>>> - group_name = str(user_info.pw_gid)
>>>>>> + pw_gid = user_info.pw_gid
>>>>>> + if isinstance(pw_gid, unicode):
>>>>>> + pw_gid = pw_gid.encode('utf-8')
>>>>>> + group_name = str(pw_gid)
>>>>>>
>>>>>> return {"name": user,
>>>>>> "uid": user_info.pw_uid,
>>>>>> @@ -263,6 +304,8 @@ class UserModel(object):
>>>>>> def _get_user_profile(self, user):
>>>>>> # ADMIN: Check /etc/sudoers.d
>>>>>> adm = libuser.admin()
>>>>>> + if isinstance(user, unicode):
>>>>>> + user = user.encode('utf-8')
>>>>>> if os.path.isfile(SUDOERS_FILE % user):
>>>>>> return 'admin'
>>>>>> else:
>>>>>> @@ -278,6 +321,8 @@ class UserModel(object):
>>>>>> return 'kimchiuser'
>>>>>>
>>>>>> def _delete_profile_settings(self, user):
>>>>>> + if isinstance(user, unicode):
>>>>>> + user = user.encode('utf-8')
>>>>>> profile = self._get_user_profile(user)
>>>>>> if profile == 'kimchiuser':
>>>>>> return
>>>
>>
>
8 years, 8 months
Wok and Kimchi 2.1.0 tagged!
by Aline Manera
Hi all,
I've just tagged the content for Wok and Kimchi 2.1 release. The
official announcement will be done tomorrow and some packages will be
available for download.
I also merged the next branch into master and deleted it. So all the
patches will be applied on master branch from now on.
Regards,
Aline Manera
8 years, 8 months
[PATCH] [Kimchi] Enabling multiselect for VEPA networks
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
This patch enables multiselect when the user chooses a VEPA network in "Add a Network" modal window.
-Multiselect is enabled when interfaces > 1
-If nothing is selected, "Create" button won't be disabled but an error message will be displayed.
-Default text when multiselect is enabled is "Select an Interface"
-Search/filter is enabled when interfaces > 10
This won't work unless the latest version of Bootstrap-select is applied (patch sent to ML).
Samuel Guimarães (1):
Enabling multiselect for VEPA networks
ui/js/src/kimchi.network_add_main.js | 10 ++++++++++
ui/pages/network-add.html.tmpl | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
--
1.8.3.1
8 years, 8 months
[PATCH] [Kimchi] Remove View Console link from guests that doesn't support vnc/spice
by Jose Ricardo Ziviani
Signed-off-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_main.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
index 2542a63..4e588e2 100644
--- a/ui/js/src/kimchi.guest_main.js
+++ b/ui/js/src/kimchi.guest_main.js
@@ -693,6 +693,8 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) {
});
consoleActions.show();
} else { //we don't recognize the VMs supported graphics, so hide the menu choice
+ result.find('.vnc-link').css("display", "none");
+ result.find('.column-vnc').html('--');
consoleActions.hide();
consoleActions.off("click", function(event) {
event.preventDefault();
--
1.9.1
8 years, 8 months
[PATCH] [Kimchi] Add 'Current' to CPU Number/CPUs where needed
by Socorro Stoppler
Adding 'Current' to CPU Number/CPUs per feedback in bugzilla# 133521
Socorro Stoppler (1):
Change CPU Number/CPUs to Current CPU Number/Current CPUs per
feedback from bugzilla# 133521
ui/pages/guest-add.html.tmpl | 2 +-
ui/pages/tabs/templates.html.tmpl | 6 +++---
ui/pages/template-edit.html.tmpl | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
--
1.9.1
8 years, 8 months
[PATCH] [Wok] Implement WokMessage class
by Lucio Correia
WokMessage is a generic message implementation, which looks
up and translates error messages for all plugins and Wok
itself.
Lookup and translation code was adapted from WokException
class, which now just uses WokMessage.
WokMessage is intended to be used by other modules dealing
with messages, such as User Request Log and future feature
Asynchronous Notifications.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
src/wok/exception.py | 45 +++-----------------------------
src/wok/message.py | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+), 41 deletions(-)
create mode 100644 src/wok/message.py
diff --git a/src/wok/exception.py b/src/wok/exception.py
index 023334b..52f007e 100644
--- a/src/wok/exception.py
+++ b/src/wok/exception.py
@@ -20,53 +20,16 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import cherrypy
-import gettext
-from wok.i18n import messages as _messages
-from wok.template import get_lang, validate_language
+from wok.message import WokMessage
class WokException(Exception):
def __init__(self, code='', args={}):
self.code = code
-
- for key, value in args.iteritems():
- if isinstance(value, unicode):
- continue
-
- # value is not unicode: convert it
- try:
- # In case the value formats itself to an ascii string.
- args[key] = unicode(str(value), 'utf-8')
- except UnicodeEncodeError:
- # In case the value is a WokException or it formats
- # itself to a unicode string.
- args[key] = unicode(value)
-
- # First, check if it is a Wok error message, then search in plugin
- # error messages list
- msg = _messages.get(code, code)
- if (msg == code) and (cherrypy.request.app):
- msg = self._get_translation()
-
- msg = unicode(msg, 'utf-8') % args
- pattern = "%s: %s" % (code, msg)
- cherrypy.log.error_log.error(pattern)
- Exception.__init__(self, pattern)
-
- def _get_translation(self):
- lang = validate_language(get_lang())
- paths = cherrypy.request.app.root.paths
- domain = cherrypy.request.app.root.domain
- messages = cherrypy.request.app.root.messages
- text = messages.get(self.code, self.code)
-
- try:
- translation = gettext.translation(domain, paths.mo_dir, [lang])
- except:
- translation = gettext
-
- return translation.gettext(text)
+ msg = WokMessage(code, args).get_text()
+ cherrypy.log.error_log.error(msg)
+ Exception.__init__(self, msg)
class NotFoundError(WokException):
diff --git a/src/wok/message.py b/src/wok/message.py
new file mode 100644
index 0000000..e982fba
--- /dev/null
+++ b/src/wok/message.py
@@ -0,0 +1,73 @@
+#
+# Project Wok
+#
+# Copyright IBM Corp, 2015-2016
+#
+# Code derived from Project Kimchi
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+import cherrypy
+import gettext
+
+from wok.template import get_lang, validate_language
+
+
+class WokMessage(object):
+ def __init__(self, code='', args={}, plugin=None):
+ # make all args unicode
+ for key, value in args.iteritems():
+ if isinstance(value, unicode):
+ continue
+
+ try:
+ # In case the value formats itself to an ascii string.
+ args[key] = unicode(str(value), 'utf-8')
+ except UnicodeEncodeError:
+ # In case the value is a WokException or it formats
+ # itself to a unicode string.
+ args[key] = unicode(value)
+
+ self.code = code
+ self.args = args
+ self.plugin = plugin
+
+ def _get_translation(self):
+ # get app from plugin path if specified
+ if self.plugin:
+ app = cherrypy.tree.apps[self.plugin]
+ # if on request, try to get app from it
+ elif cherrypy.request.app:
+ app = cherrypy.request.app
+ # fallback: get root app (WokRoot)
+ else:
+ app = cherrypy.tree.apps['']
+
+ domain = app.root.domain
+ paths = app.root.paths
+ text = app.root.messages.get(self.code, self.code)
+ lang = validate_language(get_lang())
+
+ try:
+ translation = gettext.translation(domain, paths.mo_dir, [lang])
+ except:
+ translation = gettext
+
+ return translation.gettext(text)
+
+ def get_text(self):
+ msg = self._get_translation()
+ msg = unicode(msg, 'utf-8') % self.args
+ return "%s: %s" % (self.code, msg)
--
1.9.1
8 years, 8 months
[PATCH][Kimchi] Fix memory value return when hotplug memory devs
by Rodrigo Trujillo
There is an issue when Kimchi returns the value of memory. It is
returning the current memory value, instead of the total memory, which
includes the value of the memory devices added.
This patch fix this problem returning the total value from "dom.info".
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
model/vms.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/model/vms.py b/model/vms.py
index e3bc266..396758d 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -1228,7 +1228,17 @@ class VMModel(object):
unit = 'KiB'
memory = convert_data_size(val, unit, 'MiB')
else:
- memory = info[2] >> 10
+ # If guest is running we need information in real time, in order
+ # to get real value if memory devices were added:
+ #
+ # Class Libvirt::Domain::Info
+ # cpu_time[R]
+ # max_mem[R] -> current memory plus memory devs (use it)
+ # memory[R] -> current memory only, does not include mem devs
+ # nr_virt_cpu[R]
+ # state[R]
+ #
+ memory = info[1] >> 10
# assure there is no zombie process left
for proc in self._serial_procs[:]:
--
2.1.0
8 years, 8 months