[PATCH 0/4 V2] Upgrade ObjectStore data to Kimchi-2.0

From: Paulo Vital <pvital@linux.vnet.ibm.com> This patch-set contains some fixes and changes related to upgrade process of objectstore data from Kimchi-1.5.1 (or older) to the new Wok and Kimchi-2.0 structure. This is a V2 submission completely different from V1, since it's solving the problem using a different approach, common to all supported distros, during the startup of Kimchi plugin. The patch-set was tested on Fedora 22 and Ubuntu-14.04 distros. Paulo Vital (4): Add version to objectstore information. Add Kimchi version to objectstore entries. Upgrade Kimchi objectstore content. Change Kimchi version. src/wok/objectstore.py | 20 +++++-- src/wok/plugins/kimchi/VERSION | 2 +- src/wok/plugins/kimchi/config.py.in | 5 ++ src/wok/plugins/kimchi/i18n.py | 1 + src/wok/plugins/kimchi/model/diskutils.py | 7 ++- src/wok/plugins/kimchi/model/storagepools.py | 4 +- src/wok/plugins/kimchi/model/templates.py | 4 +- src/wok/plugins/kimchi/model/vms.py | 20 ++++--- src/wok/plugins/kimchi/root.py | 10 ++++ src/wok/plugins/kimchi/tests/test_model.py | 4 +- src/wok/plugins/kimchi/utils.py | 80 +++++++++++++++++++++++++++- tests/test_objectstore.py | 5 ++ 12 files changed, 143 insertions(+), 19 deletions(-) -- 2.4.3

From: Paulo Vital <pvital@linux.vnet.ibm.com> Add support to provide version of Wok (or any other plugin) to objectstore information. Also add test case to use the new get_object_version() method. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/wok/objectstore.py | 20 ++++++++++++++++---- tests/test_objectstore.py | 5 +++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/wok/objectstore.py b/src/wok/objectstore.py index 670a363..089bf80 100644 --- a/src/wok/objectstore.py +++ b/src/wok/objectstore.py @@ -63,6 +63,12 @@ class ObjectStoreSession(object): raise NotFoundError("WOKOBJST0001E", {'item': ident}) return json.loads(jsonstr) + def get_object_version(self, obj_type, ident): + c = self.conn.cursor() + res = c.execute('SELECT version FROM objects WHERE type=? AND id=?', + (obj_type, ident)) + return [x[0] for x in res] + def delete(self, obj_type, ident, ignore_missing=False): c = self.conn.cursor() c.execute('DELETE FROM objects WHERE type=? AND id=?', @@ -72,13 +78,18 @@ class ObjectStoreSession(object): raise NotFoundError("WOKOBJST0001E", {'item': ident}) self.conn.commit() - def store(self, obj_type, ident, data): + def store(self, obj_type, ident, data, version=None): + # Get Wok version if none was provided + if version is None: + version = config.get_version().split('-')[0] + jsonstr = json.dumps(data) c = self.conn.cursor() c.execute('DELETE FROM objects WHERE type=? AND id=?', (obj_type, ident)) - c.execute('INSERT INTO objects (id, type, json) VALUES (?,?,?)', - (ident, obj_type, jsonstr)) + c.execute('''INSERT INTO objects (id, type, json, version) + VALUES (?,?,?,?)''', + (ident, obj_type, jsonstr, version)) self.conn.commit() @@ -100,7 +111,8 @@ class ObjectStore(object): # are purged every time the daemon startup if len(res) == 0: c.execute('''CREATE TABLE objects - (id TEXT, type TEXT, json TEXT, PRIMARY KEY (id, type))''') + (id TEXT, type TEXT, json TEXT, version TEXT, + PRIMARY KEY (id, type))''') conn.commit() return diff --git a/tests/test_objectstore.py b/tests/test_objectstore.py index bce125e..d11e6b7 100644 --- a/tests/test_objectstore.py +++ b/tests/test_objectstore.py @@ -26,6 +26,7 @@ import threading import unittest from wok import objectstore +from wok.config import get_version from wok.exception import NotFoundError @@ -77,6 +78,10 @@ class ObjectStoreTests(unittest.TestCase): item = session.get('fǒǒ', 'těst1') self.assertEquals(2, item[u'α']) + # Test get version of object + item = session.get_object_version('fǒǒ', 'těst1') + self.assertEquals(get_version().split('-')[0], item[0]) + def test_object_store_threaded(self): def worker(ident): with store as session: -- 2.4.3

From: Paulo Vital <pvital@linux.vnet.ibm.com> Update all ObjectStore.store() call in Kimchi to add Kimchi version to objectstore entries. To support this, add a get_kimchi_version() method into Kimchi's config.py. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/wok/plugins/kimchi/config.py.in | 5 +++++ src/wok/plugins/kimchi/model/diskutils.py | 7 +++++-- src/wok/plugins/kimchi/model/storagepools.py | 4 +++- src/wok/plugins/kimchi/model/templates.py | 4 +++- src/wok/plugins/kimchi/model/vms.py | 20 +++++++++++++------- src/wok/plugins/kimchi/tests/test_model.py | 4 +++- 6 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/wok/plugins/kimchi/config.py.in b/src/wok/plugins/kimchi/config.py.in index 43e94e1..8b43b4e 100644 --- a/src/wok/plugins/kimchi/config.py.in +++ b/src/wok/plugins/kimchi/config.py.in @@ -29,11 +29,16 @@ from wok.xmlutils.utils import xpath_get_text kimchiLock = threading.Lock() __with_spice__ = "@withspice@" +__version__ = "@kimchiversion@" # Storage pool constant for read-only pool types READONLY_POOL_TYPE = ['iscsi', 'scsi', 'mpath'] +def get_kimchi_version(): + return __version__ + + def get_distros_store(): return os.path.join(PluginPaths('kimchi').conf_dir, 'distros.d') diff --git a/src/wok/plugins/kimchi/model/diskutils.py b/src/wok/plugins/kimchi/model/diskutils.py index 076b334..b3fe116 100644 --- a/src/wok/plugins/kimchi/model/diskutils.py +++ b/src/wok/plugins/kimchi/model/diskutils.py @@ -20,6 +20,7 @@ from wok.exception import OperationFailed, NotFoundError from wok.utils import wok_log +from wok.plugins.kimchi.config import get_kimchi_version from wok.plugins.kimchi.model.vms import VMModel, VMsModel from wok.plugins.kimchi.xmlutils.disk import get_vm_disk_info, get_vm_disks @@ -49,7 +50,8 @@ def get_disk_used_by(objstore, conn, path): used_by.append(vm) try: session.store('storagevolume', path, - {'used_by': used_by}) + {'used_by': used_by}, + get_kimchi_version()) except Exception as e: # Let the exception be raised. If we allow disks' # used_by to be out of sync, data corruption could @@ -71,6 +73,7 @@ def get_disk_used_by(objstore, conn, path): def set_disk_used_by(objstore, path, new_used_by): try: with objstore as session: - session.store('storagevolume', path, {'used_by': new_used_by}) + session.store('storagevolume', path, {'used_by': new_used_by}, + get_kimchi_version()) except Exception as e: raise OperationFailed('KCHVOL0017E', {'err': e.message}) diff --git a/src/wok/plugins/kimchi/model/storagepools.py b/src/wok/plugins/kimchi/model/storagepools.py index a5c5581..cc0bc7c 100644 --- a/src/wok/plugins/kimchi/model/storagepools.py +++ b/src/wok/plugins/kimchi/model/storagepools.py @@ -28,6 +28,7 @@ from wok.exception import NotFoundError, OperationFailed from wok.utils import add_task, run_command, wok_log from wok.xmlutils.utils import xpath_get_text +from wok.plugins.kimchi.config import get_kimchi_version from wok.plugins.kimchi.model.config import CapabilitiesModel from wok.plugins.kimchi.model.host import DeviceModel from wok.plugins.kimchi.model.libvirtstoragepool import StoragePoolDef @@ -251,7 +252,8 @@ class StoragePoolsModel(object): # Record scanning-task/storagepool mapping for future querying try: with self.objstore as session: - session.store('scanning', params['name'], task_id) + session.store('scanning', params['name'], task_id, + get_kimchi_version()) return task_id except Exception as e: raise OperationFailed('KCHPOOL0037E', {'err': e.message}) diff --git a/src/wok/plugins/kimchi/model/templates.py b/src/wok/plugins/kimchi/model/templates.py index 2886c87..47b2c9e 100644 --- a/src/wok/plugins/kimchi/model/templates.py +++ b/src/wok/plugins/kimchi/model/templates.py @@ -27,6 +27,7 @@ from wok.exception import NotFoundError, OperationFailed from wok.utils import probe_file_permission_as_user, run_setfacl_set_attr from wok.xmlutils.utils import xpath_get_text +from wok.plugins.kimchi.config import get_kimchi_version from wok.plugins.kimchi.kvmusertests import UserTests from wok.plugins.kimchi.model.cpuinfo import CPUInfoModel from wok.plugins.kimchi.utils import pool_name_from_uri @@ -98,7 +99,8 @@ class TemplatesModel(object): with self.objstore as session: if name in session.get_list('template'): raise InvalidOperation("KCHTMPL0001E", {'name': name}) - session.store('template', name, t.info) + session.store('template', name, t.info, + get_kimchi_version()) except InvalidOperation: raise except Exception, e: diff --git a/src/wok/plugins/kimchi/model/vms.py b/src/wok/plugins/kimchi/model/vms.py index 63681c7..e91160c 100644 --- a/src/wok/plugins/kimchi/model/vms.py +++ b/src/wok/plugins/kimchi/model/vms.py @@ -43,7 +43,7 @@ from wok.xmlutils.utils import dictize from wok.plugins.kimchi import model from wok.plugins.kimchi import vnc -from wok.plugins.kimchi.config import READONLY_POOL_TYPE +from wok.plugins.kimchi.config import READONLY_POOL_TYPE, get_kimchi_version from wok.plugins.kimchi.kvmusertests import UserTests from wok.plugins.kimchi.model.config import CapabilitiesModel from wok.plugins.kimchi.model.featuretests import FeatureTests @@ -138,7 +138,8 @@ class VMsModel(object): if icon: try: with self.objstore as session: - session.store('vm', vm_uuid, {'icon': icon}) + session.store('vm', vm_uuid, {'icon': icon}, + get_kimchi_version()) except Exception as e: # It is possible to continue Kimchi executions without store # vm icon info @@ -480,7 +481,8 @@ class VMModel(object): # set the new disk's used_by with self.objstore as session: session.store('storagevolume', new_vol['path'], - {'used_by': [domain_name]}) + {'used_by': [domain_name]}, + get_kimchi_version()) rollback.prependDefer(_delete_disk_from_objstore, new_vol['path']) # remove the new volume should an error occur later @@ -502,7 +504,8 @@ class VMModel(object): try: vm = session.get('vm', old_uuid) icon = vm['icon'] - session.store('vm', new_uuid, {'icon': icon}) + session.store('vm', new_uuid, {'icon': icon}, + get_kimchi_version()) except NotFoundError: # if we cannot find an object store entry for the original VM, # don't store one with an empty value. @@ -1141,7 +1144,8 @@ class VMModel(object): used_by = session.get('storagevolume', path)['used_by'] used_by.remove(name) session.store('storagevolume', path, - {'used_by': used_by}) + {'used_by': used_by}, + get_kimchi_version()) except Exception as e: raise OperationFailed('KCHVOL0017E', {'err': e.message}) @@ -1400,7 +1404,8 @@ class VMScreenshotModel(object): # screenshot info changed after scratch generation try: with self.objstore as session: - session.store('screenshot', vm_uuid, screenshot.info) + session.store('screenshot', vm_uuid, screenshot.info, + get_kimchi_version()) except Exception as e: # It is possible to continue Kimchi executions without store # screenshots @@ -1416,7 +1421,8 @@ class VMScreenshotModel(object): params = session.get('screenshot', vm_uuid) except NotFoundError: params = {'uuid': vm_uuid} - session.store('screenshot', vm_uuid, params) + session.store('screenshot', vm_uuid, params, + get_kimchi_version()) except Exception as e: # The 'except' outside of 'with' is necessary to catch possible # exception from '__exit__' when calling 'session.store' diff --git a/src/wok/plugins/kimchi/tests/test_model.py b/src/wok/plugins/kimchi/tests/test_model.py index fdbe3b4..dc9fa8c 100644 --- a/src/wok/plugins/kimchi/tests/test_model.py +++ b/src/wok/plugins/kimchi/tests/test_model.py @@ -37,6 +37,7 @@ from wok.xmlutils.utils import xpath_get_text from wok.plugins.kimchi import netinfo from wok.plugins.kimchi import osinfo +from wok.plugins.kimchi.config import get_kimchi_version from wok.plugins.kimchi.config import kimchiPaths as paths from wok.plugins.kimchi.model import model from wok.plugins.kimchi.model.libvirtconnection import LibvirtConnection @@ -268,7 +269,8 @@ class ModelTests(unittest.TestCase): "storagepool": "/plugins/kimchi/storagepools/default"} with inst.objstore as session: - session.store('template', tmpl_name, tmpl_info) + session.store('template', tmpl_name, tmpl_info, + get_kimchi_version()) params = {'name': 'kimchi-vm', 'template': '/plugins/kimchi/templates/img-tmpl'} -- 2.4.3

From: Paulo Vital <pvital@linux.vnet.ibm.com> With the new structure of Wok and Kimchi, the content of the objectstore file needs to be updated to reflect the new paths of icon and storagepool present in template's and VM's information. This patch adds a step to execute an update of these contents in the previous objectstore file (older than Kimchi 1.5.1) during the startup of Kimchi 2.0.0 (or higher) plugin. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/wok/plugins/kimchi/i18n.py | 1 + src/wok/plugins/kimchi/root.py | 10 ++++++ src/wok/plugins/kimchi/utils.py | 80 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 89 insertions(+), 2 deletions(-) diff --git a/src/wok/plugins/kimchi/i18n.py b/src/wok/plugins/kimchi/i18n.py index 42a5e16..59b61de 100644 --- a/src/wok/plugins/kimchi/i18n.py +++ b/src/wok/plugins/kimchi/i18n.py @@ -262,6 +262,7 @@ messages = { "KCHHOST0004E": _("Conflicting flag filters specified."), "KCHUTILS0003E": _("Unable to choose a virtual machine name"), + "KCHUTILS0006E": _("Cannot upgrade objectstore data."), "KCHVMSTOR0002E": _("Invalid storage type. Types supported: 'cdrom', 'disk'"), "KCHVMSTOR0003E": _("The path '%(value)s' is not a valid local/remote path for the device"), diff --git a/src/wok/plugins/kimchi/root.py b/src/wok/plugins/kimchi/root.py index 37da8b3..6af053e 100644 --- a/src/wok/plugins/kimchi/root.py +++ b/src/wok/plugins/kimchi/root.py @@ -25,6 +25,8 @@ from wok.plugins.kimchi import config, mockmodel, vnc from wok.plugins.kimchi.i18n import messages from wok.plugins.kimchi.control import sub_nodes from wok.plugins.kimchi.model import model as kimchiModel +from wok.plugins.kimchi.utils import upgrade_objectstore_data +from wok.plugins.kimchi.utils import upgrade_objectstore_schema from wok.root import WokRoot @@ -62,5 +64,13 @@ class KimchiRoot(WokRoot): self.domain = 'kimchi' self.messages = messages + # Some paths or URI's present in the objectstore have changed after + # Kimchi 2.0.0 release. Check here if an upgrade in the schema and data + # are necessary. + if upgrade_objectstore_schema('version'): + upgrade_objectstore_data('icon', 'images', 'plugins/kimchi/') + upgrade_objectstore_data('storagepool', '/storagepools', + '/plugins/kimchi') + def get_custom_conf(self): return config.KimchiConfig() diff --git a/src/wok/plugins/kimchi/utils.py b/src/wok/plugins/kimchi/utils.py index 4462ce6..31def2e 100644 --- a/src/wok/plugins/kimchi/utils.py +++ b/src/wok/plugins/kimchi/utils.py @@ -19,14 +19,17 @@ # import contextlib +import json import os import re +import sqlite3 import urllib2 from httplib import HTTPConnection, HTTPException from urlparse import urlparse -from wok.exception import InvalidParameter - +from wok.exception import InvalidParameter, OperationFailed +from wok.plugins.kimchi import config +from wok.utils import wok_log MAX_REDIRECTION_ALLOWED = 5 @@ -95,3 +98,76 @@ def validate_repo_url(url): raise InvalidParameter("WOKUTILS0001E", {'url': url}) else: raise InvalidParameter("KCHREPOS0002E") + + +def get_objectstore_fields(): + """ + Return a list with all fields of the objectstore. + """ + conn = sqlite3.connect(config.get_object_store(), timeout=10) + cursor = conn.cursor() + schema_fields = [] + sql = "PRAGMA table_info('objects')" + cursor.execute(sql) + for row in cursor.fetchall(): + schema_fields.append(row[1]) + return schema_fields + + +def upgrade_objectstore_schema(field=None): + """ + Add a new column (of type TEXT) in the objectstore schema. + """ + if field is None: + wok_log.error("Cannot upgrade objectstore schema.") + return False + + if field in get_objectstore_fields(): + return False + try: + conn = sqlite3.connect(config.get_object_store(), timeout=10) + cursor = conn.cursor() + sql = "ALTER TABLE objects ADD COLUMN %s TEXT" % field + cursor.execute(sql) + wok_log.info("Objectstore schema sucessfully upgraded.") + conn.close() + except sqlite3.Error, e: + if conn: + conn.rollback() + conn.close() + wok_log.error("Cannot upgrade objectstore schema: ", e.args[0]) + return False + return True + + +def upgrade_objectstore_data(item, old_uri, new_uri): + """ + Upgrade the value of a given JSON's item of all Template and VM entries + of the objectstore from old_uri to new_uri. + """ + total = 0 + try: + conn = sqlite3.connect(config.get_object_store(), timeout=10) + cursor = conn.cursor() + sql = "SELECT id, json FROM objects WHERE type='template' OR type='vm'" + cursor.execute(sql) + for row in cursor.fetchall(): + # execute update here + template = json.loads(row[1]) + path = (template[item] if item in template else 'none') + if path.startswith(old_uri): + template[item] = new_uri + path + sql = "UPDATE objects SET json=?, version=? WHERE id=?" + cursor.execute(sql, (json.dumps(template), + config.get_kimchi_version(), row[0])) + conn.commit() + total += 1 + except sqlite3.Error, e: + if conn: + conn.rollback() + raise OperationFailed("KCHUTILS0006E") + wok_log.error("Error while upgrading objectstore data:", e.args[0]) + finally: + if conn: + conn.close() + wok_log.info("%d '%s' entries upgraded in objectstore.", total, item) -- 2.4.3

From: Paulo Vital <pvital@linux.vnet.ibm.com> Set the version of Kimchi to 2.0.0 to start reflect the correct version on objectstore data after versioning addition on objectstore schema. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/wok/plugins/kimchi/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wok/plugins/kimchi/VERSION b/src/wok/plugins/kimchi/VERSION index 26ca594..227cea2 100644 --- a/src/wok/plugins/kimchi/VERSION +++ b/src/wok/plugins/kimchi/VERSION @@ -1 +1 @@ -1.5.1 +2.0.0 -- 2.4.3

Reviewed-by: Daniel Barboza <dhbarboza82@gmail.com> Tested-by: Daniel Barboza <dhbarboza82@gmail.com> I want to add that this patchset also reduces em -1 the errors and failures of Kimchi unit tests running in pkvm. On 11/05/2015 04:47 PM, pvital@linux.vnet.ibm.com wrote:
From: Paulo Vital <pvital@linux.vnet.ibm.com>
This patch-set contains some fixes and changes related to upgrade process of objectstore data from Kimchi-1.5.1 (or older) to the new Wok and Kimchi-2.0 structure.
This is a V2 submission completely different from V1, since it's solving the problem using a different approach, common to all supported distros, during the startup of Kimchi plugin. The patch-set was tested on Fedora 22 and Ubuntu-14.04 distros.
Paulo Vital (4): Add version to objectstore information. Add Kimchi version to objectstore entries. Upgrade Kimchi objectstore content. Change Kimchi version.
src/wok/objectstore.py | 20 +++++-- src/wok/plugins/kimchi/VERSION | 2 +- src/wok/plugins/kimchi/config.py.in | 5 ++ src/wok/plugins/kimchi/i18n.py | 1 + src/wok/plugins/kimchi/model/diskutils.py | 7 ++- src/wok/plugins/kimchi/model/storagepools.py | 4 +- src/wok/plugins/kimchi/model/templates.py | 4 +- src/wok/plugins/kimchi/model/vms.py | 20 ++++--- src/wok/plugins/kimchi/root.py | 10 ++++ src/wok/plugins/kimchi/tests/test_model.py | 4 +- src/wok/plugins/kimchi/utils.py | 80 +++++++++++++++++++++++++++- tests/test_objectstore.py | 5 ++ 12 files changed, 143 insertions(+), 19 deletions(-)

I believe this patch set broke the existing objectstores of Ginger and Ginger-base. Here's the output when I've tried to use the existing Ginger objstore with current WoK: dir: '/home/danielhb/kimchi/wok/kimchi/src/wok/plugins/ginger/ui/images' [23/Nov/2015:10:45:18] ENGINE Started monitor thread 'Autoreloader'. [23/Nov/2015:10:45:19] ENGINE Serving on http://127.0.0.1:37848 [23/Nov/2015:10:45:19] ENGINE Bus STARTED Traceback (most recent call last): File "/home/danielhb/kimchi/wok/kimchi/src/wok/asynctask.py", line 65, in _save_helper session.store('task', self.id, obj) File "/home/danielhb/kimchi/wok/kimchi/src/wok/objectstore.py", line 92, in store (ident, obj_type, jsonstr, version)) OperationalError: table objects has no column named version WOKASYNC0002E: WOKASYNC0002E The same changes made here must be made to the existing object stores of Ginger and Ginger base, in my opinion. On 11/05/2015 04:47 PM, pvital@linux.vnet.ibm.com wrote:
From: Paulo Vital <pvital@linux.vnet.ibm.com>
This patch-set contains some fixes and changes related to upgrade process of objectstore data from Kimchi-1.5.1 (or older) to the new Wok and Kimchi-2.0 structure.
This is a V2 submission completely different from V1, since it's solving the problem using a different approach, common to all supported distros, during the startup of Kimchi plugin. The patch-set was tested on Fedora 22 and Ubuntu-14.04 distros.
Paulo Vital (4): Add version to objectstore information. Add Kimchi version to objectstore entries. Upgrade Kimchi objectstore content. Change Kimchi version.
src/wok/objectstore.py | 20 +++++-- src/wok/plugins/kimchi/VERSION | 2 +- src/wok/plugins/kimchi/config.py.in | 5 ++ src/wok/plugins/kimchi/i18n.py | 1 + src/wok/plugins/kimchi/model/diskutils.py | 7 ++- src/wok/plugins/kimchi/model/storagepools.py | 4 +- src/wok/plugins/kimchi/model/templates.py | 4 +- src/wok/plugins/kimchi/model/vms.py | 20 ++++--- src/wok/plugins/kimchi/root.py | 10 ++++ src/wok/plugins/kimchi/tests/test_model.py | 4 +- src/wok/plugins/kimchi/utils.py | 80 +++++++++++++++++++++++++++- tests/test_objectstore.py | 5 ++ 12 files changed, 143 insertions(+), 19 deletions(-)

If Ginger and GingerBase use the objectstore databases, so it's necessary to work on them. I'll see this and send a patch. Best regards, Paulo Vital. On Mon, 2015-11-23 at 10:49 -0200, Daniel Henrique Barboza wrote:
I believe this patch set broke the existing objectstores of Ginger and Ginger-base. Here's the output when I've tried to use the existing Ginger objstore with current WoK:
dir: '/home/danielhb/kimchi/wok/kimchi/src/wok/plugins/ginger/ui/images'
[23/Nov/2015:10:45:18] ENGINE Started monitor thread 'Autoreloader'. [23/Nov/2015:10:45:19] ENGINE Serving on http://127.0.0.1:37848 [23/Nov/2015:10:45:19] ENGINE Bus STARTED Traceback (most recent call last): File "/home/danielhb/kimchi/wok/kimchi/src/wok/asynctask.py", line 65, in _save_helper session.store('task', self.id, obj) File "/home/danielhb/kimchi/wok/kimchi/src/wok/objectstore.py", line 92, in store (ident, obj_type, jsonstr, version)) OperationalError: table objects has no column named version
WOKASYNC0002E: WOKASYNC0002E
The same changes made here must be made to the existing object stores of Ginger and Ginger base, in my opinion.
On 11/05/2015 04:47 PM, pvital@linux.vnet.ibm.com wrote:
From: Paulo Vital <pvital@linux.vnet.ibm.com>
This patch-set contains some fixes and changes related to upgrade process of objectstore data from Kimchi-1.5.1 (or older) to the new Wok and Kimchi-2.0 structure.
This is a V2 submission completely different from V1, since it's solving the problem using a different approach, common to all supported distros, during the startup of Kimchi plugin. The patch-set was tested on Fedora 22 and Ubuntu-14.04 distros.
Paulo Vital (4): Add version to objectstore information. Add Kimchi version to objectstore entries. Upgrade Kimchi objectstore content. Change Kimchi version.
src/wok/objectstore.py | 20 +++++-- src/wok/plugins/kimchi/VERSION | 2 +- src/wok/plugins/kimchi/config.py.in | 5 ++ src/wok/plugins/kimchi/i18n.py | 1 + src/wok/plugins/kimchi/model/diskutils.py | 7 ++- src/wok/plugins/kimchi/model/storagepools.py | 4 +- src/wok/plugins/kimchi/model/templates.py | 4 +- src/wok/plugins/kimchi/model/vms.py | 20 ++++--- src/wok/plugins/kimchi/root.py | 10 ++++ src/wok/plugins/kimchi/tests/test_model.py | 4 +- src/wok/plugins/kimchi/utils.py | 80 +++++++++++++++++++++++++++- tests/test_objectstore.py | 5 ++ 12 files changed, 143 insertions(+), 19 deletions(-)
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
participants (4)
-
Aline Manera
-
Daniel Henrique Barboza
-
Paulo Ricardo Paz Vital
-
pvital@linux.vnet.ibm.com