[PATCH][Kimchi] Improve checking of cpu_info API (json schema)
by Rodrigo Trujillo
This patch adds a checking, retricting parameters expected in
"cpu_info" and in "cpu_info: {topology }.
Only defined parameters are allowed and new error messages are displayed
if parameters do not fit requirement.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
API.json | 8 ++++++--
i18n.py | 2 ++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/API.json b/API.json
index ff505b1..590bc52 100644
--- a/API.json
+++ b/API.json
@@ -62,9 +62,13 @@
"minimum": 1,
"error": "KCHTMPL0026E"
}
- }
+ },
+ "additionalProperties": false,
+ "error": "KCHCPUINF0009E"
}
- }
+ },
+ "additionalProperties": false,
+ "error": "KCHCPUINF0008E"
},
"memory": {
"description": "Current memory and maximum memory values",
diff --git a/i18n.py b/i18n.py
index 12b70fa..6491f72 100644
--- a/i18n.py
+++ b/i18n.py
@@ -325,6 +325,8 @@ messages = {
"KCHCPUINF0005E": _("When CPU topology is defined, vCPUs must be a multiple of a product of cores and threads."),
"KCHCPUINF0006E": _("The number of threads is too large for this system."),
"KCHCPUINF0007E": _("When CPU topology is specified, sockets, cores and threads are required paramaters."),
+ "KCHCPUINF0008E": _("Parameter 'cpu_info' expects an object with fields among: 'vcpus', 'maxvcpus', 'topology'."),
+ "KCHCPUINF0009E": _("Parameter 'topology' expects an object with fields among: 'sockets', 'cores', 'threads'."),
"KCHLVMS0001E": _("Invalid volume group name parameter: %(name)s."),
--
2.1.0
8 years, 8 months
[PATCH V2] [Kimchi 0/2] Add support for editing virtual networks
by Lucio Correia
Lucio Correia (2):
Add backend support for editing virtual networks
Add network update tests
Changes in V2:
- code review
- bugfix in restoring original network
API.json | 32 ++++++++++++++++++++++++++++++
control/networks.py | 1 +
docs/API.md | 9 +++++++++
i18n.py | 8 +++++---
model/networks.py | 48 ++++++++++++++++++++++++++++++++++++++++++++-
tests/test_model_network.py | 19 +++++++++++++++++-
6 files changed, 112 insertions(+), 5 deletions(-)
--
1.9.1
8 years, 8 months
Looking for input on #105
by Archana Singh
Hello,
I have raised issue "logging of datetime in ISO format along with
timezone in *.log". I am looking for input on these aspect.
Thanks,
Archana
8 years, 8 months
[PATCH v3] [Kimchi] Issue #920: Template is removed if an ISO doesn't exist
by Jose Ricardo Ziviani
- This commit changes the way the template update works. Now, it
really updates the existing template instead of creating a new
one (and deleting the old one)
Signed-off-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
---
i18n.py | 3 +++
model/templates.py | 70 ++++++++++++++++++++++++++++++++------------------
tests/test_template.py | 6 ++++-
3 files changed, 53 insertions(+), 26 deletions(-)
diff --git a/i18n.py b/i18n.py
index 7cce796..e4656cb 100644
--- a/i18n.py
+++ b/i18n.py
@@ -155,8 +155,10 @@ messages = {
"KCHVMIF0011E": _("Cannot change MAC address of a running virtual machine"),
"KCHTMPL0001E": _("Template %(name)s already exists"),
+ "KCHTMPL0002E": _("Source media %(path)s not found"),
"KCHTMPL0003E": _("Network '%(network)s' specified for template %(template)s does not exist"),
"KCHTMPL0004E": _("Storage pool %(pool)s specified for template %(template)s does not exist"),
+ "KCHTMPL0005E": _("Template %(name)s does not exist."),
"KCHTMPL0006E": _("Invalid parameter '%(param)s' specified for CDROM."),
"KCHTMPL0007E": _("Network %(network)s specified for template %(template)s is not active"),
"KCHTMPL0008E": _("Template name must be a string"),
@@ -181,6 +183,7 @@ messages = {
"KCHTMPL0029E": _("Disk format must be 'raw', for logical, iscsi, and scsi pools."),
"KCHTMPL0030E": _("Memory expects an object with one or both parameters: 'current' and 'maxmemory'"),
"KCHTMPL0031E": _("Memory value (%(mem)sMiB) must be equal or lesser than maximum memory value (%(maxmem)sMiB)"),
+ "KCHTMPL0032E": _("Unable to update template due error: %(err)s"),
"KCHPOOL0001E": _("Storage pool %(name)s already exists"),
"KCHPOOL0002E": _("Storage pool %(name)s does not exist"),
diff --git a/model/templates.py b/model/templates.py
index a02099c..d0742ca 100644
--- a/model/templates.py
+++ b/model/templates.py
@@ -51,7 +51,7 @@ class TemplatesModel(object):
self.objstore = kargs['objstore']
self.conn = kargs['conn']
- def create(self, params):
+ def _validate_template_params(self, params):
name = params.get('name', '').strip()
conn = self.conn.get()
@@ -72,8 +72,7 @@ class TemplatesModel(object):
# image does not exists: raise error
elif not os.path.exists(path):
- raise InvalidParameter("Unable to find file %(path)s" %
- {"path": path})
+ raise InvalidParameter("KCHTMPL0002E", {'path': path})
# create magic object to discover file type
file_type = magic.open(magic.MAGIC_NONE)
@@ -99,10 +98,6 @@ class TemplatesModel(object):
params["disks"] = params.get('disks', [])
params["disks"].append({"base": path})
- return self.save_template(params)
-
- def save_template(self, params):
-
# Creates the template class with necessary information
t = LibvirtVMTemplate(params, scan=True, conn=self.conn)
@@ -119,16 +114,18 @@ class TemplatesModel(object):
if 'volume' in disk.keys():
self.template_volume_validate(volume, disk['pool'])
- # template with the same name already exists: raise exception
- name = params['name']
- with self.objstore as session:
- if name in session.get_list('template'):
- raise InvalidOperation("KCHTMPL0001E", {'name': name})
+ return t
+
+ def create(self, params):
+ template = self._validate_template_params(params)
# Store template on objectstore
+ name = params['name']
try:
with self.objstore as session:
- session.store('template', name, t.info,
+ if name in session.get_list('template'):
+ raise InvalidOperation("KCHTMPL0001E", {'name': name})
+ session.store('template', name, template.info,
get_kimchi_version())
except InvalidOperation:
raise
@@ -191,7 +188,8 @@ class TemplateModel(object):
temp = self.lookup(name)
temp['name'] = clone_name
- ident = self.templates.save_template(temp)
+ temp['source_media'] = temp.get('base', temp['cdrom'])
+ ident = self.templates.create(temp)
return ident
def delete(self, name):
@@ -204,31 +202,36 @@ class TemplateModel(object):
raise OperationFailed('KCHTMPL0021E', {'err': e.message})
def update(self, name, params):
- old_t = self.lookup(name)
- new_t = copy.copy(old_t)
+ edit_template = self.lookup(name)
+
+ edit_template['source_media'] = edit_template.get(
+ 'base', edit_template['cdrom'])
+
+ if 'cdrom' in params:
+ edit_template['source_media'] = params['cdrom']
# Merge graphics settings
graph_args = params.get('graphics')
if graph_args:
- graphics = dict(new_t['graphics'])
+ graphics = dict(edit_template['graphics'])
graphics.update(graph_args)
params['graphics'] = graphics
# Merge cpu_info settings
new_cpu_info = params.get('cpu_info')
if new_cpu_info:
- cpu_info = dict(new_t['cpu_info'])
+ cpu_info = dict(edit_template['cpu_info'])
cpu_info.update(new_cpu_info)
params['cpu_info'] = cpu_info
# Fix memory values, because method update does not work recursively
new_mem = params.get('memory')
if new_mem is not None:
- params['memory'] = copy.copy(old_t.get('memory'))
+ params['memory'] = copy.copy(edit_template.get('memory'))
params['memory'].update(new_mem)
validate_memory(params['memory'])
- new_t.update(params)
+ edit_template.update(params)
for net_name in params.get(u'networks', []):
try:
@@ -238,13 +241,30 @@ class TemplateModel(object):
raise InvalidParameter("KCHTMPL0003E", {'network': net_name,
'template': name})
- self.delete(name)
+ template = self.templates._validate_template_params(edit_template)
+
try:
- ident = self.templates.save_template(new_t)
- except:
- ident = self.templates.save_template(old_t)
+ with self.objstore as session:
+ if name not in session.get_list('template'):
+ raise InvalidOperation("KCHTMPL0005E", {'name': name})
+
+ if template.info['name'] != name and \
+ template.info['name'] in session.get_list('template'):
+ raise InvalidOperation("KCHTMPL0001E",
+ {'name': template.info['name']})
+
+ if template.info['name'] != name:
+ session.delete('template', name)
+
+ session.store('template', template.info['name'],
+ template.info, get_kimchi_version())
+
+ except InvalidOperation:
raise
- return ident
+ except Exception, e:
+ raise OperationFailed('KCHTMPL0032E', {'err': e.message})
+
+ return template.info['name']
def validate_memory(memory):
diff --git a/tests/test_template.py b/tests/test_template.py
index 158bbeb..f0ef030 100644
--- a/tests/test_template.py
+++ b/tests/test_template.py
@@ -256,7 +256,11 @@ class TemplateTests(unittest.TestCase):
self.assertEquals(1024, update_tmpl['memory']['maxmemory'])
# Update cdrom
- cdrom_data = {'cdrom': '/tmp/mock2.iso'}
+ cdrom_data = {'cdrom': 'inexistent.iso'}
+ resp = self.request(new_tmpl_uri, json.dumps(cdrom_data), 'PUT')
+ self.assertEquals(400, resp.status)
+
+ cdrom_data = {'cdrom': '/tmp/existent.iso'}
resp = self.request(new_tmpl_uri, json.dumps(cdrom_data), 'PUT')
self.assertEquals(200, resp.status)
update_tmpl = json.loads(resp.read())
--
1.9.1
8 years, 8 months
[PATCH V2] [Kimchi 0/3] Issue #372: Add support to netboot installation.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
V2:
* Adapted patch to new template API (automatic detection of cdrom)
V1:
This patchset adds support in backend to create templates and guests to netboot
without setting a cdrom path or URL as image to install. Once created a guest
to boot via network, the guest will request DHCP/TFTP/(NFS/HTTP/FTP) network
installation servers to download the configured images and start the install.
Reference: http://miud.in/1Ht3
To test, use the curl commands (look the parameters used):
$ curl -k -u test -H "Content-Type: application/json" -H \
"Accept: application/json" 'https://localhost:8001/plugins/kimchi/templates' \
-X POST -d '{"name": "test-netboot", "source_media": "netboot"}'
Enter host password for user 'test':
{
"cpu_info":{
"maxvcpus":1,
"vcpus":1
},
"graphics":{
"type":"vnc",
"listen":"127.0.0.1"
},
"cdrom":null,
"networks":[
"default"
],
"icon":"plugins/kimchi/images/icon-vm.png",
"os_distro":"unknown",
"name":"test-netboot",
"disks":[
{
"index":0,
"format":"qcow2",
"pool":{
"type":"dir",
"name":"/plugins/kimchi/storagepools/default"
},
"size":10
}
],
"invalid":{},
"os_version":"unknown",
"memory":{
"current":1024,
"maxmemory":1024
},
"folder":[]
}
$ curl -k -u test -H "Content-Type: application/json" -H \
"Accept: application/json" 'https://localhost:8001/plugins/kimchi/vms' -X POST \
-d '{"name":"1netboot-test","template":"/plugins/kimchi/templates/test-netboot"}'
Enter host password for user 'test':
{
"status":"running",
"message":"Provisioning storages for new VM",
"id":"1",
"target_uri":"/plugins/kimchi/vms/1netboot-test"
}
$ sudo virsh dumpxml 1netboot-test
<domain type='kvm'>
<name>1netboot-test</name>
<uuid>5c9fa5b3-3203-4c93-92d6-2b4103fe7b40</uuid>
<metadata>
<kimchi:metadata xmlns:kimchi="https://github.com/kimchi-project/kimchi">
<kimchi:os version="unknown" distro="unknown"/>
</kimchi:metadata>
</metadata>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<memtune>
<hard_limit unit='KiB'>2097152</hard_limit>
</memtune>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-2.4'>hvm</type>
<boot dev='hd'/>
<boot dev='cdrom'/>
<boot dev='network'/>
</os>
<acpi/>
<apic/>
<pae/>
</features>
<cpu>
<numa>
<cell id='0' cpus='0' memory='1048576' unit='KiB'/>
</numa>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/var/lib/libvirt/images/5c9fa5b3-3203-4c93-92d6-2b4103fe7b40-0.img'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='network'>
<mac address='52:54:00:ea:7e:ad'/>
<source network='default'/>
<model type='e1000'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>
Paulo Vital (3):
Add support to create netboot templates.
Add support to create guests to netboot.
Update test cases to support netboot.
API.json | 4 ++--
model/templates.py | 11 ++++++++++-
tests/test_template.py | 17 +++++++++++++++++
tests/test_vmtemplate.py | 18 ++++++++++++++++++
vmtemplate.py | 25 ++++++++++++++-----------
xmlutils/bootorder.py | 45 +++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 106 insertions(+), 14 deletions(-)
create mode 100644 xmlutils/bootorder.py
--
2.5.5
8 years, 8 months
[PATCH V3] [Kimchi 0/3] Issue #372: Add support to netboot installation.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
V3:
* set network as third default option to boot order
V2:
* Adapted patch to new template API (automatic detection of cdrom)
V1:
This patchset adds support in backend to create templates and guests to netboot
without setting a cdrom path or URL as image to install. Once created a guest
to boot via network, the guest will request DHCP/TFTP/(NFS/HTTP/FTP) network
installation servers to download the configured images and start the install.
Reference: http://miud.in/1Ht3
To test, use the curl commands (look the parameters used):
$ curl -k -u test -H "Content-Type: application/json" -H \
"Accept: application/json" 'https://localhost:8001/plugins/kimchi/templates' \
-X POST -d '{"name": "test-netboot", "source_media": "netboot"}'
Enter host password for user 'test':
{
"cpu_info":{
"maxvcpus":1,
"vcpus":1
},
"graphics":{
"type":"vnc",
"listen":"127.0.0.1"
},
"cdrom":null,
"networks":[
"default"
],
"icon":"plugins/kimchi/images/icon-vm.png",
"os_distro":"unknown",
"name":"test-netboot",
"disks":[
{
"index":0,
"format":"qcow2",
"pool":{
"type":"dir",
"name":"/plugins/kimchi/storagepools/default"
},
"size":10
}
],
"invalid":{},
"os_version":"unknown",
"memory":{
"current":1024,
"maxmemory":1024
},
"folder":[]
}
$ curl -k -u test -H "Content-Type: application/json" -H \
"Accept: application/json" 'https://localhost:8001/plugins/kimchi/vms' -X POST \
-d '{"name":"1netboot-test","template":"/plugins/kimchi/templates/test-netboot"}'
Enter host password for user 'test':
{
"status":"running",
"message":"Provisioning storages for new VM",
"id":"1",
"target_uri":"/plugins/kimchi/vms/1netboot-test"
}
$ sudo virsh dumpxml 1netboot-test
<domain type='kvm'>
<name>1netboot-test</name>
<uuid>5c9fa5b3-3203-4c93-92d6-2b4103fe7b40</uuid>
<metadata>
<kimchi:metadata xmlns:kimchi="https://github.com/kimchi-project/kimchi">
<kimchi:os version="unknown" distro="unknown"/>
</kimchi:metadata>
</metadata>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<memtune>
<hard_limit unit='KiB'>2097152</hard_limit>
</memtune>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-2.4'>hvm</type>
<boot dev='hd'/>
<boot dev='cdrom'/>
<boot dev='network'/>
</os>
<acpi/>
<apic/>
<pae/>
</features>
<cpu>
<numa>
<cell id='0' cpus='0' memory='1048576' unit='KiB'/>
</numa>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/var/lib/libvirt/images/5c9fa5b3-3203-4c93-92d6-2b4103fe7b40-0.img'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='network'>
<mac address='52:54:00:ea:7e:ad'/>
<source network='default'/>
<model type='e1000'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>
Paulo Vital (3):
Add support to create netboot templates.
Add support to create guests to netboot.
Update test cases to support netboot.
API.json | 4 ++--
model/templates.py | 11 ++++++++++-
tests/test_template.py | 17 +++++++++++++++++
tests/test_vmtemplate.py | 18 ++++++++++++++++++
vmtemplate.py | 22 ++++++++++++----------
5 files changed, 59 insertions(+), 13 deletions(-)
--
2.5.5
8 years, 8 months
[PATCH v2] [Kimchi] Replace backing image by clone when using template based on existing img
by Jose Ricardo Ziviani
- This commit replaces the current backing image to a complete clone
when using a template based on an existing template.
Signed-off-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
---
model/templates.py | 17 ++++++++++++++++-
vmtemplate.py | 8 --------
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/model/templates.py b/model/templates.py
index a02099c..9ae7f5e 100644
--- a/model/templates.py
+++ b/model/templates.py
@@ -378,7 +378,22 @@ class LibvirtVMTemplate(VMTemplate):
for v in vol_list:
pool = self._get_storage_pool(v['pool'])
# outgoing text to libvirt, encode('utf-8')
- pool.createXML(v['xml'].encode('utf-8'), 0)
+ if 'base' in v and 'path' in v['base']:
+ conn = self.conn.get()
+ try:
+ volume_base = conn.storageVolLookupByPath(
+ v['base']['path'])
+
+ except libvirt.libvirtError as e:
+ pool.createXML(v['xml'].encode('utf-8'), 0)
+ continue
+
+ pool.createXMLFrom(v['xml'].encode('utf-8'),
+ volume_base,
+ 0)
+ else:
+ pool.createXML(v['xml'].encode('utf-8'), 0)
+
except libvirt.libvirtError as e:
raise OperationFailed("KCHVMSTOR0008E", {'error': e.message})
return vol_list
diff --git a/vmtemplate.py b/vmtemplate.py
index a223beb..4ce5d19 100644
--- a/vmtemplate.py
+++ b/vmtemplate.py
@@ -264,14 +264,6 @@ class VMTemplate(object):
v_tree.append(E.capacity(str(info['capacity']), unit='G'))
target_fmt = info['format']
- if 'base' in d:
- # target must be qcow2 in order to use a backing file
- target_fmt = 'qcow2'
-
- v_tree.append(E.backingStore(
- E.path(info['base']['path']),
- E.format(type=info['base']['format'])))
-
target = E.target(
E.format(type=target_fmt), E.path(info['path']))
v_tree.append(target)
--
1.9.1
8 years, 8 months
[PATCH] [Wok] Update AsyncResource class with delete method.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Added the method delete to AysncResource class to be able to execute DELETE
requests as AsyncTask.
This patch is part of solution to Kimchi issue #817
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
src/wok/control/base.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/wok/control/base.py b/src/wok/control/base.py
index 25f6522..7aeb844 100644
--- a/src/wok/control/base.py
+++ b/src/wok/control/base.py
@@ -294,6 +294,22 @@ class AsyncResource(Resource):
cherrypy.response.status = 202
return wok.template.render('Task', self.info)
+ def delete(self):
+ try:
+ fn = getattr(self.model, model_fn(self, 'delete'))
+ task = fn(*self.model_args)
+ except AttributeError:
+ e = InvalidOperation('WOKAPI0002E', {'resource':
+ get_class_name(self)})
+ raise cherrypy.HTTPError(405, e.message)
+ except OperationFailed, e:
+ raise cherrypy.HTTPError(500, e.message)
+ except InvalidOperation, e:
+ raise cherrypy.HTTPError(400, e.message)
+
+ cherrypy.response.status = 202
+ return wok.template.render("Task", task)
+
class Collection(object):
"""
--
2.5.5
8 years, 8 months
[PATCH] [Wok] Issue #103: Wok Table List item looks like URL link
by rajgupta@linux.vnet.ibm.com
From: Rajat Gupta <rajat.triumph(a)gmail.com>
Changed CSS from link to Background color for Wok Table List items
Signed-off-by: Rajat Gupta <rajat.triumph(a)gmail.com>
---
ui/css/src/modules/_wok-grid.scss | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ui/css/src/modules/_wok-grid.scss b/ui/css/src/modules/_wok-grid.scss
index 730d224..e511900 100644
--- a/ui/css/src/modules/_wok-grid.scss
+++ b/ui/css/src/modules/_wok-grid.scss
@@ -72,8 +72,7 @@
}
.wok-list-content tbody tr:hover {
- text-decoration: underline;
- cursor: pointer;
+ background: #ddd;
}
.wok-list-content tbody tr.generating:hover {
--
2.1.0
8 years, 8 months
[PATCH] [Wok] Seperate method to get accept-language.
by archus@linux.vnet.ibm.com
From: Archana Singh <archus(a)linux.vnet.ibm.com>
Seperated method to get the accept-langauage,
which can be used if format of number/timestamp has
to be done based on it.
Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
---
src/wok/template.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/wok/template.py b/src/wok/template.py
index 09f4dbe..b47041a 100644
--- a/src/wok/template.py
+++ b/src/wok/template.py
@@ -34,6 +34,12 @@ def get_lang():
if "wokLang" in cookie.keys():
return [cookie["wokLang"].value]
+ langs = get_accept_language()
+
+ return langs
+
+
+def get_accept_language():
lang = cherrypy.request.headers.get("Accept-Language", "en_US")
if lang and lang.find(';') != -1:
@@ -46,7 +52,6 @@ def get_lang():
langCountry = val.split('-')
langCountry[1] = langCountry[1].upper()
langs[idx] = "_".join(langCountry)
-
return langs
--
2.5.0
8 years, 8 months