This patch adapts imports to the new file structure and
updates imported names in code. No other code changes.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
Signed-off-by: Gustavo Y. Ribeiro <gyr(a)linux.vnet.ibm.com>
---
plugins/kimchi/control/__init__.py | 2 +-
plugins/kimchi/control/config.py | 4 +-
plugins/kimchi/control/cpuinfo.py | 2 +-
plugins/kimchi/control/debugreports.py | 6 +-
plugins/kimchi/control/groups.py | 4 +-
plugins/kimchi/control/host.py | 8 ++--
plugins/kimchi/control/interfaces.py | 4 +-
plugins/kimchi/control/networks.py | 4 +-
plugins/kimchi/control/peers.py | 4 +-
plugins/kimchi/control/storagepools.py | 12 +++---
plugins/kimchi/control/storageservers.py | 8 ++--
plugins/kimchi/control/storagevolumes.py | 8 ++--
plugins/kimchi/control/tasks.py | 4 +-
plugins/kimchi/control/templates.py | 4 +-
plugins/kimchi/control/users.py | 6 +-
plugins/kimchi/control/vm/__init__.py | 2 +-
plugins/kimchi/control/vm/hostdevs.py | 4 +-
plugins/kimchi/control/vm/ifaces.py | 4 +-
plugins/kimchi/control/vm/snapshots.py | 4 +-
plugins/kimchi/control/vm/storages.py | 4 +-
plugins/kimchi/control/vms.py | 6 +-
plugins/kimchi/disks.py | 4 +-
plugins/kimchi/distroloader.py | 6 +-
plugins/kimchi/imageinfo.py | 4 +-
plugins/kimchi/iscsi.py | 2 +-
plugins/kimchi/isoinfo.py | 4 +-
plugins/kimchi/kvmusertests.py | 2 +-
plugins/kimchi/mockmodel.py | 40 ++++++++--------
plugins/kimchi/model/config.py | 25 +++++-----
plugins/kimchi/model/cpuinfo.py | 4 +-
plugins/kimchi/model/debugreports.py | 12 +++---
plugins/kimchi/model/diskutils.py | 8 ++--
plugins/kimchi/model/featuretests.py | 4 +-
plugins/kimchi/model/groups.py | 2 +-
plugins/kimchi/model/host.py | 26 +++++-----
plugins/kimchi/model/hostdev.py | 6 +-
plugins/kimchi/model/interfaces.py | 6 +-
plugins/kimchi/model/libvirtconnection.py | 2 +-
plugins/kimchi/model/libvirtstoragepool.py | 8 ++--
plugins/kimchi/model/model.py | 10 ++--
plugins/kimchi/model/networks.py | 22 +++++-----
plugins/kimchi/model/peers.py | 4 +-
plugins/kimchi/model/storagepools.py | 21 +++++----
plugins/kimchi/model/storageservers.py | 4 +-
plugins/kimchi/model/storagetargets.py | 6 +-
plugins/kimchi/model/storagevolumes.py | 20 ++++----
plugins/kimchi/model/tasks.py | 2 +-
plugins/kimchi/model/templates.py | 16 +++---
plugins/kimchi/model/users.py | 4 +-
plugins/kimchi/model/utils.py | 2 +-
plugins/kimchi/model/vmhostdevs.py | 16 +++---
plugins/kimchi/model/vmifaces.py | 10 ++--
plugins/kimchi/model/vms.py | 48 ++++++++++---------
plugins/kimchi/model/vmsnapshots.py | 12 +++---
plugins/kimchi/model/vmstorages.py | 22 +++++-----
plugins/kimchi/osinfo.py | 2 +-
plugins/kimchi/repositories.py | 12 +++---
plugins/kimchi/scan.py | 4 +-
plugins/kimchi/screenshot.py | 4 +-
plugins/kimchi/swupdate.py | 10 ++--
plugins/kimchi/tests/iso_gen.py | 2 +-
plugins/kimchi/tests/run_tests.sh.in | 2 +-
plugins/kimchi/tests/test_authorization.py | 6 +-
plugins/kimchi/tests/test_config.py.in | 4 +-
plugins/kimchi/tests/test_exception.py | 6 +-
plugins/kimchi/tests/test_host.py | 2 +-
plugins/kimchi/tests/test_mock_network.py | 2 +-
plugins/kimchi/tests/test_mock_storagepool.py | 2 +-
plugins/kimchi/tests/test_mock_storagevolume.py | 2 +-
plugins/kimchi/tests/test_mockmodel.py | 6 +-
plugins/kimchi/tests/test_model.py | 24 +++++-----
plugins/kimchi/tests/test_model_network.py | 4 +-
plugins/kimchi/tests/test_model_storagepool.py | 4 +-
plugins/kimchi/tests/test_model_storagevolume.py | 9 ++--
plugins/kimchi/tests/test_networkxml.py | 4 +-
plugins/kimchi/tests/test_objectstore.py | 4 +-
plugins/kimchi/tests/test_osinfo.py | 4 +-
plugins/kimchi/tests/test_plugin.py | 8 ++--
plugins/kimchi/tests/test_rest.py | 12 +++---
plugins/kimchi/tests/test_rollbackcontext.py | 2 +-
plugins/kimchi/tests/test_server.py | 4 +-
plugins/kimchi/tests/test_storagepoolxml.py | 2 +-
plugins/kimchi/tests/test_template.py | 4 +-
plugins/kimchi/tests/test_utils.py | 4 +-
plugins/kimchi/tests/test_vmtemplate.py | 6 +-
plugins/kimchi/tests/test_yumparser.py | 12 +++---
plugins/kimchi/tests/utils.py | 20 ++++----
plugins/kimchi/ui/pages/error.html.tmpl | 2 +-
plugins/kimchi/ui/pages/guest-add.html.tmpl | 2 +-
.../kimchi/ui/pages/guest-storage-add.html.tmpl | 2 +-
plugins/kimchi/ui/pages/guest.html.tmpl | 2 +-
plugins/kimchi/ui/pages/i18n.json.tmpl | 2 +-
plugins/kimchi/ui/pages/report-add.html.tmpl | 2 +-
plugins/kimchi/ui/pages/report-rename.html.tmpl | 2 +-
plugins/kimchi/ui/pages/repository-add.html.tmpl | 2 +-
plugins/kimchi/ui/pages/repository-edit.html.tmpl | 2 +-
.../ui/pages/storagepool-add-volume.html.tmpl | 2 +-
plugins/kimchi/ui/pages/tabs/guests.html.tmpl | 2 +-
plugins/kimchi/ui/pages/tabs/host.html.tmpl | 2 +-
plugins/kimchi/ui/pages/tabs/network.html.tmpl | 2 +-
plugins/kimchi/ui/pages/tabs/templates.html.tmpl | 2 +-
plugins/kimchi/ui/pages/template-add.html.tmpl | 2 +-
plugins/kimchi/ui/pages/template-edit.html.tmpl | 2 +-
plugins/kimchi/vmtemplate.py | 23 +++++-----
plugins/kimchi/xmlutils/disk.py | 4 +-
plugins/kimchi/xmlutils/interface.py | 2 +-
plugins/sample/__init__.py | 6 +-
plugins/sample/model.py | 4 +-
plugins/sample/sample.conf.in | 2 +-
plugins/sample/ui/pages/i18n.json.tmpl | 2 +-
src/wok/asynctask.py | 2 +-
src/wok/auth.py | 8 ++--
src/wok/cachebust.py | 2 +-
src/wok/control/__init__.py | 2 +-
src/wok/control/base.py | 26 +++++-----
src/wok/control/plugins.py | 4 +-
src/wok/control/utils.py | 6 +-
src/wok/exception.py | 4 +-
src/wok/model/plugins.py | 2 +-
src/wok/objectstore.py | 6 +-
src/wok/proxy.py | 4 +-
src/wok/root.py | 16 +++---
src/wok/server.py | 20 ++++----
src/wok/template.py | 2 +-
src/wok/utils.py | 6 +-
src/wok/vnc.py | 2 +-
src/wokd.in | 6 +-
ui/pages/error.html.tmpl | 2 +-
ui/pages/i18n.json.tmpl | 2 +-
ui/pages/login.html.tmpl | 4 +-
ui/pages/wok-ui.html.tmpl | 4 +-
131 files changed, 446 insertions(+), 440 deletions(-)
diff --git a/plugins/kimchi/control/__init__.py b/plugins/kimchi/control/__init__.py
index 98d42d3..4ad9459 100644
--- a/plugins/kimchi/control/__init__.py
+++ b/plugins/kimchi/control/__init__.py
@@ -20,7 +20,7 @@
import os
-from kimchi.control.utils import load_url_sub_node
+from wok.control.utils import load_url_sub_node
sub_nodes = load_url_sub_node(os.path.dirname(__file__), __name__)
diff --git a/plugins/kimchi/control/config.py b/plugins/kimchi/control/config.py
index 45bb013..15df68f 100644
--- a/plugins/kimchi/control/config.py
+++ b/plugins/kimchi/control/config.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import Collection, Resource
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import Collection, Resource
+from wok.control.utils import UrlSubNode
@UrlSubNode("config")
diff --git a/plugins/kimchi/control/cpuinfo.py b/plugins/kimchi/control/cpuinfo.py
index 415dd3d..31f316c 100644
--- a/plugins/kimchi/control/cpuinfo.py
+++ b/plugins/kimchi/control/cpuinfo.py
@@ -18,7 +18,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import Resource
+from wok.control.base import Resource
class CPUInfo(Resource):
diff --git a/plugins/kimchi/control/debugreports.py
b/plugins/kimchi/control/debugreports.py
index 377d002..b5a3072 100644
--- a/plugins/kimchi/control/debugreports.py
+++ b/plugins/kimchi/control/debugreports.py
@@ -17,9 +17,9 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import AsyncCollection, Resource
-from kimchi.control.utils import internal_redirect
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import AsyncCollection, Resource
+from wok.control.utils import internal_redirect
+from wok.control.utils import UrlSubNode
@UrlSubNode('debugreports', True)
diff --git a/plugins/kimchi/control/groups.py b/plugins/kimchi/control/groups.py
index f18b2ab..649ff09 100644
--- a/plugins/kimchi/control/groups.py
+++ b/plugins/kimchi/control/groups.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import SimpleCollection
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import SimpleCollection
+from wok.control.utils import UrlSubNode
@UrlSubNode('groups', True)
diff --git a/plugins/kimchi/control/host.py b/plugins/kimchi/control/host.py
index 5e736db..6634d8f 100644
--- a/plugins/kimchi/control/host.py
+++ b/plugins/kimchi/control/host.py
@@ -17,10 +17,10 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.cpuinfo import CPUInfo
-from kimchi.control.base import Collection, Resource, SimpleCollection
-from kimchi.control.utils import UrlSubNode
-from kimchi.exception import NotFoundError
+from cpuinfo import CPUInfo
+from wok.control.base import Collection, Resource, SimpleCollection
+from wok.control.utils import UrlSubNode
+from wok.exception import NotFoundError
@UrlSubNode('host', True)
diff --git a/plugins/kimchi/control/interfaces.py b/plugins/kimchi/control/interfaces.py
index 3c76f3f..d698b7a 100644
--- a/plugins/kimchi/control/interfaces.py
+++ b/plugins/kimchi/control/interfaces.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import Collection, Resource
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import Collection, Resource
+from wok.control.utils import UrlSubNode
@UrlSubNode('interfaces', True)
diff --git a/plugins/kimchi/control/networks.py b/plugins/kimchi/control/networks.py
index 42e013f..fd92111 100644
--- a/plugins/kimchi/control/networks.py
+++ b/plugins/kimchi/control/networks.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import Collection, Resource
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import Collection, Resource
+from wok.control.utils import UrlSubNode
@UrlSubNode('networks', True)
diff --git a/plugins/kimchi/control/peers.py b/plugins/kimchi/control/peers.py
index f72a38c..21e9f13 100644
--- a/plugins/kimchi/control/peers.py
+++ b/plugins/kimchi/control/peers.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import SimpleCollection
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import SimpleCollection
+from wok.control.utils import UrlSubNode
@UrlSubNode("peers", True)
diff --git a/plugins/kimchi/control/storagepools.py
b/plugins/kimchi/control/storagepools.py
index ee74bee..4a83c20 100644
--- a/plugins/kimchi/control/storagepools.py
+++ b/plugins/kimchi/control/storagepools.py
@@ -19,12 +19,12 @@
import cherrypy
-from kimchi.control.base import Collection, Resource
-from kimchi.control.storagevolumes import IsoVolumes, StorageVolumes
-from kimchi.control.utils import get_class_name, model_fn
-from kimchi.control.utils import validate_params
-from kimchi.model.storagepools import ISO_POOL_NAME
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import Collection, Resource
+from storagevolumes import IsoVolumes, StorageVolumes
+from wok.control.utils import get_class_name, model_fn
+from wok.control.utils import validate_params
+from ..model.storagepools import ISO_POOL_NAME
+from wok.control.utils import UrlSubNode
@UrlSubNode('storagepools', True)
diff --git a/plugins/kimchi/control/storageservers.py
b/plugins/kimchi/control/storageservers.py
index 4b70c39..654ab47 100644
--- a/plugins/kimchi/control/storageservers.py
+++ b/plugins/kimchi/control/storageservers.py
@@ -17,9 +17,9 @@
# 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 kimchi.template
-from kimchi.control.base import Collection, Resource
-from kimchi.control.utils import get_class_name, model_fn, UrlSubNode
+from wok import template
+from wok.control.base import Collection, Resource
+from wok.control.utils import get_class_name, model_fn, UrlSubNode
@UrlSubNode('storageservers', True)
@@ -57,4 +57,4 @@ class StorageTargets(Collection):
res_list = []
get_list = getattr(self.model, model_fn(self, 'get_list'))
res_list = get_list(*self.model_args, **filter_params)
- return kimchi.template.render(get_class_name(self), res_list)
+ return template.render(get_class_name(self), res_list)
diff --git a/plugins/kimchi/control/storagevolumes.py
b/plugins/kimchi/control/storagevolumes.py
index 8af7abc..bbe6627 100644
--- a/plugins/kimchi/control/storagevolumes.py
+++ b/plugins/kimchi/control/storagevolumes.py
@@ -17,9 +17,9 @@
# 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 kimchi.template
-from kimchi.control.base import AsyncCollection, Collection, Resource
-from kimchi.control.utils import get_class_name, model_fn
+from wok import template
+from wok.control.base import AsyncCollection, Collection, Resource
+from wok.control.utils import get_class_name, model_fn
class StorageVolumes(AsyncCollection):
@@ -80,4 +80,4 @@ class IsoVolumes(Collection):
except AttributeError:
pass
- return kimchi.template.render(get_class_name(self), res_list)
+ return template.render(get_class_name(self), res_list)
diff --git a/plugins/kimchi/control/tasks.py b/plugins/kimchi/control/tasks.py
index 4870dbd..b25d892 100644
--- a/plugins/kimchi/control/tasks.py
+++ b/plugins/kimchi/control/tasks.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import Collection, Resource
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import Collection, Resource
+from wok.control.utils import UrlSubNode
@UrlSubNode("tasks", True)
diff --git a/plugins/kimchi/control/templates.py b/plugins/kimchi/control/templates.py
index 4c45910..fc58815 100644
--- a/plugins/kimchi/control/templates.py
+++ b/plugins/kimchi/control/templates.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import Collection, Resource
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import Collection, Resource
+from wok.control.utils import UrlSubNode
@UrlSubNode('templates', True)
diff --git a/plugins/kimchi/control/users.py b/plugins/kimchi/control/users.py
index 45603d0..756a2f7 100644
--- a/plugins/kimchi/control/users.py
+++ b/plugins/kimchi/control/users.py
@@ -17,9 +17,9 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import SimpleCollection
-from kimchi.control.utils import get_class_name, model_fn, UrlSubNode
-from kimchi.template import render
+from wok.control.base import SimpleCollection
+from wok.control.utils import get_class_name, model_fn, UrlSubNode
+from wok.template import render
@UrlSubNode('users', True)
diff --git a/plugins/kimchi/control/vm/__init__.py
b/plugins/kimchi/control/vm/__init__.py
index 2ea1e8c..a311045 100644
--- a/plugins/kimchi/control/vm/__init__.py
+++ b/plugins/kimchi/control/vm/__init__.py
@@ -20,7 +20,7 @@
import os
-from kimchi.control.utils import load_url_sub_node
+from wok.control.utils import load_url_sub_node
sub_nodes = load_url_sub_node(os.path.dirname(__file__), __name__)
diff --git a/plugins/kimchi/control/vm/hostdevs.py
b/plugins/kimchi/control/vm/hostdevs.py
index 1eb88cf..a43b9d8 100644
--- a/plugins/kimchi/control/vm/hostdevs.py
+++ b/plugins/kimchi/control/vm/hostdevs.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import Collection, Resource
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import Collection, Resource
+from wok.control.utils import UrlSubNode
@UrlSubNode("hostdevs")
diff --git a/plugins/kimchi/control/vm/ifaces.py b/plugins/kimchi/control/vm/ifaces.py
index 8a60217..ac957fd 100644
--- a/plugins/kimchi/control/vm/ifaces.py
+++ b/plugins/kimchi/control/vm/ifaces.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import Collection, Resource
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import Collection, Resource
+from wok.control.utils import UrlSubNode
@UrlSubNode("ifaces")
diff --git a/plugins/kimchi/control/vm/snapshots.py
b/plugins/kimchi/control/vm/snapshots.py
index bbebc9a..dd17b85 100644
--- a/plugins/kimchi/control/vm/snapshots.py
+++ b/plugins/kimchi/control/vm/snapshots.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import AsyncCollection, Resource
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import AsyncCollection, Resource
+from wok.control.utils import UrlSubNode
@UrlSubNode('snapshots')
diff --git a/plugins/kimchi/control/vm/storages.py
b/plugins/kimchi/control/vm/storages.py
index 81a5d48..f502caa 100644
--- a/plugins/kimchi/control/vm/storages.py
+++ b/plugins/kimchi/control/vm/storages.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import Collection, Resource
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import Collection, Resource
+from wok.control.utils import UrlSubNode
@UrlSubNode("storages")
diff --git a/plugins/kimchi/control/vms.py b/plugins/kimchi/control/vms.py
index a40b56e..c8105bc 100644
--- a/plugins/kimchi/control/vms.py
+++ b/plugins/kimchi/control/vms.py
@@ -17,9 +17,9 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import AsyncCollection, Resource
-from kimchi.control.utils import internal_redirect, UrlSubNode
-from kimchi.control.vm import sub_nodes
+from wok.control.base import AsyncCollection, Resource
+from wok.control.utils import internal_redirect, UrlSubNode
+from vm import sub_nodes
@UrlSubNode('vms', True)
diff --git a/plugins/kimchi/disks.py b/plugins/kimchi/disks.py
index 016a079..59e52f9 100644
--- a/plugins/kimchi/disks.py
+++ b/plugins/kimchi/disks.py
@@ -24,8 +24,8 @@ import subprocess
from parted import Device as PDevice
from parted import Disk as PDisk
-from kimchi.exception import OperationFailed
-from kimchi.utils import kimchi_log
+from wok.exception import OperationFailed
+from wok.utils import kimchi_log
def _get_dev_node_path(maj_min):
diff --git a/plugins/kimchi/distroloader.py b/plugins/kimchi/distroloader.py
index daed73c..8ad34d2 100644
--- a/plugins/kimchi/distroloader.py
+++ b/plugins/kimchi/distroloader.py
@@ -23,9 +23,9 @@ import json
import os
-from kimchi import config
-from kimchi.exception import NotFoundError, OperationFailed
-from kimchi.utils import kimchi_log
+import config
+from wok.exception import NotFoundError, OperationFailed
+from wok.utils import kimchi_log
ARCHS = {'x86_64': ['x86_64', 'amd64', 'i686',
'x86', 'i386'],
diff --git a/plugins/kimchi/imageinfo.py b/plugins/kimchi/imageinfo.py
index 89d1e0a..fbd1396 100644
--- a/plugins/kimchi/imageinfo.py
+++ b/plugins/kimchi/imageinfo.py
@@ -22,8 +22,8 @@ import os
import sys
import guestfs
-from kimchi.exception import ImageFormatError, InvalidParameter, TimeoutExpired
-from kimchi.utils import run_command, kimchi_log
+from wok.exception import ImageFormatError, InvalidParameter, TimeoutExpired
+from wok.utils import run_command, kimchi_log
def probe_img_info(path):
diff --git a/plugins/kimchi/iscsi.py b/plugins/kimchi/iscsi.py
index b3e1b78..02886ac 100644
--- a/plugins/kimchi/iscsi.py
+++ b/plugins/kimchi/iscsi.py
@@ -20,7 +20,7 @@
import subprocess
-from kimchi.exception import OperationFailed
+from wok.exception import OperationFailed
class TargetClient(object):
diff --git a/plugins/kimchi/isoinfo.py b/plugins/kimchi/isoinfo.py
index 6fb0f38..de9c359 100644
--- a/plugins/kimchi/isoinfo.py
+++ b/plugins/kimchi/isoinfo.py
@@ -28,8 +28,8 @@ import sys
import urllib2
-from kimchi.exception import IsoFormatError
-from kimchi.utils import check_url_path, kimchi_log
+from wok.exception import IsoFormatError
+from wok.utils import check_url_path, kimchi_log
iso_dir = [
diff --git a/plugins/kimchi/kvmusertests.py b/plugins/kimchi/kvmusertests.py
index 5724267..ace157e 100644
--- a/plugins/kimchi/kvmusertests.py
+++ b/plugins/kimchi/kvmusertests.py
@@ -22,7 +22,7 @@ import threading
import libvirt
-from kimchi.rollbackcontext import RollbackContext
+from wok.rollbackcontext import RollbackContext
KVMUSERTEST_VM_NAME = "KVMUSERTEST_VM"
diff --git a/plugins/kimchi/mockmodel.py b/plugins/kimchi/mockmodel.py
index aaf1af2..384ce9b 100644
--- a/plugins/kimchi/mockmodel.py
+++ b/plugins/kimchi/mockmodel.py
@@ -23,29 +23,29 @@ import os
import random
import time
-import kimchi.model.cpuinfo
+from model import cpuinfo
from lxml import objectify
from lxml.builder import E
-from kimchi import config
-from kimchi import imageinfo
-from kimchi import osinfo
-from kimchi.exception import NotFoundError, OperationFailed
-from kimchi.model.debugreports import DebugReportsModel
-from kimchi.model.host import DeviceModel
-from kimchi.model.libvirtstoragepool import IscsiPoolDef, NetfsPoolDef
-from kimchi.model.libvirtstoragepool import StoragePoolDef
-from kimchi.model.model import Model
-from kimchi.model.storagepools import StoragePoolModel
-from kimchi.model.storagevolumes import StorageVolumeModel, StorageVolumesModel
-from kimchi.model.templates import LibvirtVMTemplate
-from kimchi.model.users import PAMUsersModel
-from kimchi.model.groups import PAMGroupsModel
-from kimchi.objectstore import ObjectStore
-from kimchi.utils import add_task, get_next_clone_name, kimchi_log
-from kimchi.vmtemplate import VMTemplate
-from kimchi.xmlutils.utils import xml_item_update
+import config
+import imageinfo
+import osinfo
+from wok.exception import NotFoundError, OperationFailed
+from model.debugreports import DebugReportsModel
+from model.host import DeviceModel
+from model.libvirtstoragepool import IscsiPoolDef, NetfsPoolDef
+from model.libvirtstoragepool import StoragePoolDef
+from model.model import Model
+from model.storagepools import StoragePoolModel
+from model.storagevolumes import StorageVolumeModel, StorageVolumesModel
+from model.templates import LibvirtVMTemplate
+from model.users import PAMUsersModel
+from model.groups import PAMGroupsModel
+from wok.objectstore import ObjectStore
+from wok.utils import add_task, get_next_clone_name, kimchi_log
+from vmtemplate import VMTemplate
+from wok.xmlutils.utils import xml_item_update
fake_user = {'root': 'letmein!'}
@@ -74,7 +74,7 @@ class MockModel(Model):
self._mock_swupdate = MockSoftwareUpdate()
self._mock_repositories = MockRepositories()
- kimchi.model.cpuinfo.get_topo_capabilities = \
+ cpuinfo.get_topo_capabilities = \
MockModel.get_topo_capabilities
libvirt.virConnect.defineXML = MockModel.domainDefineXML
libvirt.virDomain.XMLDesc = MockModel.domainXMLDesc
diff --git a/plugins/kimchi/model/config.py b/plugins/kimchi/model/config.py
index d894b21..6f593e3 100644
--- a/plugins/kimchi/model/config.py
+++ b/plugins/kimchi/model/config.py
@@ -21,18 +21,19 @@ from multiprocessing.pool import ThreadPool
import cherrypy
-from kimchi.basemodel import Singleton
-from kimchi.config import config as kconfig
-from kimchi.config import find_qemu_binary, get_version
-from kimchi.distroloader import DistroLoader
-from kimchi.exception import NotFoundError
-from kimchi.model.debugreports import DebugReportsModel
-from kimchi.model.featuretests import FeatureTests, FEATURETEST_POOL_NAME
-from kimchi.model.featuretests import FEATURETEST_VM_NAME
-from kimchi.repositories import Repositories
-from kimchi.screenshot import VMScreenshot
-from kimchi.swupdate import SoftwareUpdate
-from kimchi.utils import check_url_path, kimchi_log, run_command
+from wok.basemodel import Singleton
+from wok.config import config as kconfig
+from wok.config import get_version
+from ..config import find_qemu_binary
+from ..distroloader import DistroLoader
+from wok.exception import NotFoundError
+from debugreports import DebugReportsModel
+from featuretests import FeatureTests, FEATURETEST_POOL_NAME
+from featuretests import FEATURETEST_VM_NAME
+from ..repositories import Repositories
+from ..screenshot import VMScreenshot
+from ..swupdate import SoftwareUpdate
+from wok.utils import check_url_path, kimchi_log, run_command
class ConfigModel(object):
diff --git a/plugins/kimchi/model/cpuinfo.py b/plugins/kimchi/model/cpuinfo.py
index 548aa3e..54d6eaa 100644
--- a/plugins/kimchi/model/cpuinfo.py
+++ b/plugins/kimchi/model/cpuinfo.py
@@ -21,8 +21,8 @@ import platform
from xml.etree import ElementTree as ET
-from kimchi.exception import InvalidParameter, InvalidOperation
-from kimchi.utils import kimchi_log, run_command
+from wok.exception import InvalidParameter, InvalidOperation
+from wok.utils import kimchi_log, run_command
ARCH = 'power' if platform.machine().startswith('ppc') else
'x86'
diff --git a/plugins/kimchi/model/debugreports.py b/plugins/kimchi/model/debugreports.py
index 5f74da8..6cc8819 100644
--- a/plugins/kimchi/model/debugreports.py
+++ b/plugins/kimchi/model/debugreports.py
@@ -25,12 +25,12 @@ import shutil
import subprocess
import time
-from kimchi import config
-from kimchi.exception import InvalidParameter, KimchiException, NotFoundError
-from kimchi.exception import OperationFailed
-from kimchi.model.tasks import TaskModel
-from kimchi.utils import add_task, kimchi_log
-from kimchi.utils import run_command
+from .. import config
+from wok.exception import InvalidParameter, KimchiException, NotFoundError
+from wok.exception import OperationFailed
+from tasks import TaskModel
+from wok.utils import add_task, kimchi_log
+from wok.utils import run_command
class DebugReportsModel(object):
diff --git a/plugins/kimchi/model/diskutils.py b/plugins/kimchi/model/diskutils.py
index 0be2024..041a135 100644
--- a/plugins/kimchi/model/diskutils.py
+++ b/plugins/kimchi/model/diskutils.py
@@ -18,10 +18,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.exception import OperationFailed, NotFoundError
-from kimchi.model.vms import VMModel, VMsModel
-from kimchi.utils import kimchi_log
-from kimchi.xmlutils.disk import get_vm_disk_info, get_vm_disks
+from wok.exception import OperationFailed, NotFoundError
+from vms import VMModel, VMsModel
+from wok.utils import kimchi_log
+from ..xmlutils.disk import get_vm_disk_info, get_vm_disks
"""
Functions that multiple storage-related models (e.g. VMStoragesModel,
diff --git a/plugins/kimchi/model/featuretests.py b/plugins/kimchi/model/featuretests.py
index 047108f..16fd25e 100644
--- a/plugins/kimchi/model/featuretests.py
+++ b/plugins/kimchi/model/featuretests.py
@@ -25,8 +25,8 @@ import subprocess
from lxml.builder import E
-from kimchi.rollbackcontext import RollbackContext
-from kimchi.utils import kimchi_log, run_command, servermethod
+from wok.rollbackcontext import RollbackContext
+from wok.utils import kimchi_log, run_command, servermethod
FEATURETEST_VM_NAME = "FEATURETEST_VM"
FEATURETEST_POOL_NAME = "FEATURETEST_POOL"
diff --git a/plugins/kimchi/model/groups.py b/plugins/kimchi/model/groups.py
index 0af3f8f..fc63d68 100644
--- a/plugins/kimchi/model/groups.py
+++ b/plugins/kimchi/model/groups.py
@@ -19,7 +19,7 @@
import grp
-from kimchi.config import config
+from wok.config import config
class GroupsModel(object):
diff --git a/plugins/kimchi/model/host.py b/plugins/kimchi/model/host.py
index b2fa379..f1f0b83 100644
--- a/plugins/kimchi/model/host.py
+++ b/plugins/kimchi/model/host.py
@@ -26,19 +26,19 @@ from collections import defaultdict
import psutil
from cherrypy.process.plugins import BackgroundTask
-from kimchi import disks
-from kimchi import netinfo
-from kimchi.basemodel import Singleton
-from kimchi.model import hostdev
-from kimchi.exception import InvalidOperation, InvalidParameter
-from kimchi.exception import NotFoundError, OperationFailed
-from kimchi.model.config import CapabilitiesModel
-from kimchi.model.tasks import TaskModel
-from kimchi.model.vms import DOM_STATE_MAP
-from kimchi.repositories import Repositories
-from kimchi.swupdate import SoftwareUpdate
-from kimchi.utils import add_task, kimchi_log
-from kimchi.xmlutils.utils import xpath_get_text
+from .. import disks
+from wok import netinfo
+from wok.basemodel import Singleton
+import hostdev
+from wok.exception import InvalidOperation, InvalidParameter
+from wok.exception import NotFoundError, OperationFailed
+from config import CapabilitiesModel
+from tasks import TaskModel
+from vms import DOM_STATE_MAP
+from ..repositories import Repositories
+from ..swupdate import SoftwareUpdate
+from wok.utils import add_task, kimchi_log
+from wok.xmlutils.utils import xpath_get_text
HOST_STATS_INTERVAL = 1
diff --git a/plugins/kimchi/model/hostdev.py b/plugins/kimchi/model/hostdev.py
index 2a4a311..34a8e1b 100644
--- a/plugins/kimchi/model/hostdev.py
+++ b/plugins/kimchi/model/hostdev.py
@@ -21,9 +21,9 @@ import os
from pprint import pformat
from pprint import pprint
-from kimchi.model.libvirtconnection import LibvirtConnection
-from kimchi.utils import kimchi_log
-from kimchi.xmlutils.utils import dictize
+from libvirtconnection import LibvirtConnection
+from wok.utils import kimchi_log
+from wok.xmlutils.utils import dictize
def _get_all_host_dev_infos(libvirt_conn):
diff --git a/plugins/kimchi/model/interfaces.py b/plugins/kimchi/model/interfaces.py
index 4069caf..5ccadc7 100644
--- a/plugins/kimchi/model/interfaces.py
+++ b/plugins/kimchi/model/interfaces.py
@@ -17,9 +17,9 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi import netinfo
-from kimchi.exception import NotFoundError
-from kimchi.model.networks import NetworksModel
+from wok import netinfo
+from wok.exception import NotFoundError
+from networks import NetworksModel
class InterfacesModel(object):
diff --git a/plugins/kimchi/model/libvirtconnection.py
b/plugins/kimchi/model/libvirtconnection.py
index 7a5337c..4a4eee4 100644
--- a/plugins/kimchi/model/libvirtconnection.py
+++ b/plugins/kimchi/model/libvirtconnection.py
@@ -23,7 +23,7 @@ import time
import cherrypy
import libvirt
-from kimchi.utils import kimchi_log
+from wok.utils import kimchi_log
class LibvirtConnection(object):
diff --git a/plugins/kimchi/model/libvirtstoragepool.py
b/plugins/kimchi/model/libvirtstoragepool.py
index c6deafc..b7a8291 100644
--- a/plugins/kimchi/model/libvirtstoragepool.py
+++ b/plugins/kimchi/model/libvirtstoragepool.py
@@ -24,10 +24,10 @@ from lxml.builder import E
import libvirt
-from kimchi.exception import InvalidParameter, OperationFailed, TimeoutExpired
-from kimchi.iscsi import TargetClient
-from kimchi.rollbackcontext import RollbackContext
-from kimchi.utils import kimchi_log, parse_cmd_output, run_command
+from wok.exception import InvalidParameter, OperationFailed, TimeoutExpired
+from ..iscsi import TargetClient
+from wok.rollbackcontext import RollbackContext
+from wok.utils import kimchi_log, parse_cmd_output, run_command
class StoragePoolDef(object):
diff --git a/plugins/kimchi/model/model.py b/plugins/kimchi/model/model.py
index 40ebc98..33dea12 100644
--- a/plugins/kimchi/model/model.py
+++ b/plugins/kimchi/model/model.py
@@ -20,10 +20,10 @@
import inspect
import os
-from kimchi.basemodel import BaseModel
-from kimchi.model.libvirtconnection import LibvirtConnection
-from kimchi.objectstore import ObjectStore
-from kimchi.utils import import_module, listPathModules
+from wok.basemodel import BaseModel
+from libvirtconnection import LibvirtConnection
+from wok.objectstore import ObjectStore
+from wok.utils import import_module, listPathModules
class Model(BaseModel):
@@ -41,7 +41,7 @@ class Model(BaseModel):
if mod_name.startswith("_") or mod_name == this_mod:
continue
- module = import_module('model.' + mod_name)
+ module = import_module('plugins.kimchi.model.' + mod_name)
members = inspect.getmembers(module, inspect.isclass)
for cls_name, instance in members:
if inspect.getmodule(instance) == module:
diff --git a/plugins/kimchi/model/networks.py b/plugins/kimchi/model/networks.py
index 275e12b..7a3dfc8 100644
--- a/plugins/kimchi/model/networks.py
+++ b/plugins/kimchi/model/networks.py
@@ -25,17 +25,17 @@ import libvirt
from xml.sax.saxutils import escape
-from kimchi import netinfo
-from kimchi import network as knetwork
-from kimchi.config import paths
-from kimchi.exception import InvalidOperation, InvalidParameter
-from kimchi.exception import MissingParameter, NotFoundError, OperationFailed
-from kimchi.osinfo import defaults as tmpl_defaults
-from kimchi.rollbackcontext import RollbackContext
-from kimchi.utils import kimchi_log, run_command
-from kimchi.xmlutils.network import create_vlan_tagged_bridge_xml
-from kimchi.xmlutils.network import to_network_xml
-from kimchi.xmlutils.utils import xpath_get_text
+from wok import netinfo
+from wok import network as knetwork
+from wok.config import paths
+from wok.exception import InvalidOperation, InvalidParameter
+from wok.exception import MissingParameter, NotFoundError, OperationFailed
+from ..osinfo import defaults as tmpl_defaults
+from wok.rollbackcontext import RollbackContext
+from wok.utils import kimchi_log, run_command
+from ..xmlutils.network import create_vlan_tagged_bridge_xml
+from ..xmlutils.network import to_network_xml
+from wok.xmlutils.utils import xpath_get_text
KIMCHI_BRIDGE_PREFIX = 'kb'
diff --git a/plugins/kimchi/model/peers.py b/plugins/kimchi/model/peers.py
index 0d4227b..ef70b1e 100644
--- a/plugins/kimchi/model/peers.py
+++ b/plugins/kimchi/model/peers.py
@@ -21,8 +21,8 @@ import cherrypy
import re
import socket
-from kimchi.config import config
-from kimchi.utils import kimchi_log, run_command
+from wok.config import config
+from wok.utils import kimchi_log, run_command
class PeersModel(object):
diff --git a/plugins/kimchi/model/storagepools.py b/plugins/kimchi/model/storagepools.py
index f022deb..6d9c8cf 100644
--- a/plugins/kimchi/model/storagepools.py
+++ b/plugins/kimchi/model/storagepools.py
@@ -23,16 +23,17 @@ import sys
from lxml.builder import E
-from kimchi.config import config, paths
-from kimchi.scan import Scanner
-from kimchi.exception import InvalidOperation, MissingParameter
-from kimchi.exception import NotFoundError, OperationFailed
-from kimchi.model.config import CapabilitiesModel
-from kimchi.model.host import DeviceModel
-from kimchi.model.libvirtstoragepool import StoragePoolDef
-from kimchi.osinfo import defaults as tmpl_defaults
-from kimchi.utils import add_task, kimchi_log, pool_name_from_uri, run_command
-from kimchi.xmlutils.utils import xpath_get_text
+from wok.config import config, paths
+from ..scan import Scanner
+from wok.exception import InvalidOperation, MissingParameter
+from wok.exception import NotFoundError, OperationFailed
+from config import CapabilitiesModel
+from host import DeviceModel
+from libvirtstoragepool import StoragePoolDef
+from ..osinfo import defaults as tmpl_defaults
+from wok.utils import add_task, kimchi_log, run_command
+from ..utils import pool_name_from_uri
+from wok.xmlutils.utils import xpath_get_text
ISO_POOL_NAME = u'kimchi_isos'
diff --git a/plugins/kimchi/model/storageservers.py
b/plugins/kimchi/model/storageservers.py
index dcdb74a..17e1289 100644
--- a/plugins/kimchi/model/storageservers.py
+++ b/plugins/kimchi/model/storageservers.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.exception import NotFoundError
-from kimchi.model.storagepools import StoragePoolModel, StoragePoolsModel
+from wok.exception import NotFoundError
+from storagepools import StoragePoolModel, StoragePoolsModel
# Types of remote storage servers supported
STORAGE_SERVERS = ['netfs', 'iscsi']
diff --git a/plugins/kimchi/model/storagetargets.py
b/plugins/kimchi/model/storagetargets.py
index 159f987..dd88fec 100644
--- a/plugins/kimchi/model/storagetargets.py
+++ b/plugins/kimchi/model/storagetargets.py
@@ -22,9 +22,9 @@ import lxml.etree as ET
from lxml import objectify
from lxml.builder import E
-from kimchi.model.config import CapabilitiesModel
-from kimchi.model.storageservers import STORAGE_SERVERS
-from kimchi.utils import kimchi_log, patch_find_nfs_target
+from config import CapabilitiesModel
+from storageservers import STORAGE_SERVERS
+from wok.utils import kimchi_log, patch_find_nfs_target
class StorageTargetsModel(object):
diff --git a/plugins/kimchi/model/storagevolumes.py
b/plugins/kimchi/model/storagevolumes.py
index 22856ff..92e1c7c 100644
--- a/plugins/kimchi/model/storagevolumes.py
+++ b/plugins/kimchi/model/storagevolumes.py
@@ -28,16 +28,16 @@ from lxml.builder import E
import libvirt
-from kimchi.config import READONLY_POOL_TYPE
-from kimchi.exception import InvalidOperation, InvalidParameter, IsoFormatError
-from kimchi.exception import MissingParameter, NotFoundError, OperationFailed
-from kimchi.isoinfo import IsoImage
-from kimchi.model.diskutils import get_disk_used_by, set_disk_used_by
-from kimchi.model.storagepools import StoragePoolModel
-from kimchi.model.tasks import TaskModel
-from kimchi.utils import add_task, get_next_clone_name, get_unique_file_name
-from kimchi.utils import kimchi_log
-from kimchi.xmlutils.utils import xpath_get_text
+from ..config import READONLY_POOL_TYPE
+from wok.exception import InvalidOperation, InvalidParameter, IsoFormatError
+from wok.exception import MissingParameter, NotFoundError, OperationFailed
+from ..isoinfo import IsoImage
+from diskutils import get_disk_used_by, set_disk_used_by
+from storagepools import StoragePoolModel
+from tasks import TaskModel
+from wok.utils import add_task, get_next_clone_name, get_unique_file_name
+from wok.utils import kimchi_log
+from wok.xmlutils.utils import xpath_get_text
VOLUME_TYPE_MAP = {0: 'file',
diff --git a/plugins/kimchi/model/tasks.py b/plugins/kimchi/model/tasks.py
index 61bc2f3..678fdc2 100644
--- a/plugins/kimchi/model/tasks.py
+++ b/plugins/kimchi/model/tasks.py
@@ -20,7 +20,7 @@
import time
-from kimchi.exception import TimeoutExpired
+from wok.exception import TimeoutExpired
class TasksModel(object):
diff --git a/plugins/kimchi/model/templates.py b/plugins/kimchi/model/templates.py
index ef83706..0f1f6be 100644
--- a/plugins/kimchi/model/templates.py
+++ b/plugins/kimchi/model/templates.py
@@ -23,14 +23,14 @@ import stat
import libvirt
-from kimchi.exception import InvalidOperation, InvalidParameter
-from kimchi.exception import NotFoundError, OperationFailed
-from kimchi.kvmusertests import UserTests
-from kimchi.model.cpuinfo import CPUInfoModel
-from kimchi.utils import pool_name_from_uri
-from kimchi.utils import probe_file_permission_as_user, run_setfacl_set_attr
-from kimchi.vmtemplate import VMTemplate
-from kimchi.xmlutils.utils import xpath_get_text
+from wok.exception import InvalidOperation, InvalidParameter
+from wok.exception import NotFoundError, OperationFailed
+from ..kvmusertests import UserTests
+from cpuinfo import CPUInfoModel
+from ..utils import pool_name_from_uri
+from wok.utils import probe_file_permission_as_user, run_setfacl_set_attr
+from ..vmtemplate import VMTemplate
+from wok.xmlutils.utils import xpath_get_text
class TemplatesModel(object):
diff --git a/plugins/kimchi/model/users.py b/plugins/kimchi/model/users.py
index 1422bae..2fa65dd 100644
--- a/plugins/kimchi/model/users.py
+++ b/plugins/kimchi/model/users.py
@@ -20,8 +20,8 @@
import ldap
import pwd
-from kimchi.config import config
-from kimchi.exception import NotFoundError
+from wok.config import config
+from wok.exception import NotFoundError
class UsersModel(object):
diff --git a/plugins/kimchi/model/utils.py b/plugins/kimchi/model/utils.py
index 7f27edd..878390f 100644
--- a/plugins/kimchi/model/utils.py
+++ b/plugins/kimchi/model/utils.py
@@ -21,7 +21,7 @@ import libvirt
from lxml import etree, objectify
from lxml.builder import E, ElementMaker
-from kimchi.exception import OperationFailed
+from wok.exception import OperationFailed
KIMCHI_META_URL = "https://github.com/kimchi-project/kimchi"
KIMCHI_NAMESPACE = "kimchi"
diff --git a/plugins/kimchi/model/vmhostdevs.py b/plugins/kimchi/model/vmhostdevs.py
index ea75fce..f8c87dd 100644
--- a/plugins/kimchi/model/vmhostdevs.py
+++ b/plugins/kimchi/model/vmhostdevs.py
@@ -24,14 +24,14 @@ import libvirt
from lxml import etree, objectify
from lxml.builder import E
-from kimchi.exception import InvalidOperation, InvalidParameter, NotFoundError
-from kimchi.exception import OperationFailed
-from kimchi.model.config import CapabilitiesModel
-from kimchi.model.host import DeviceModel, DevicesModel
-from kimchi.model.utils import get_vm_config_flag
-from kimchi.model.vms import DOM_STATE_MAP, VMModel
-from kimchi.rollbackcontext import RollbackContext
-from kimchi.utils import kimchi_log, run_command
+from wok.exception import InvalidOperation, InvalidParameter, NotFoundError
+from wok.exception import OperationFailed
+from config import CapabilitiesModel
+from host import DeviceModel, DevicesModel
+from utils import get_vm_config_flag
+from vms import DOM_STATE_MAP, VMModel
+from wok.rollbackcontext import RollbackContext
+from wok.utils import kimchi_log, run_command
import platform
diff --git a/plugins/kimchi/model/vmifaces.py b/plugins/kimchi/model/vmifaces.py
index 93a769b..fe136e3 100644
--- a/plugins/kimchi/model/vmifaces.py
+++ b/plugins/kimchi/model/vmifaces.py
@@ -22,11 +22,11 @@ import random
import libvirt
from lxml import etree, objectify
-from kimchi.exception import InvalidParameter, MissingParameter
-from kimchi.exception import NotFoundError, InvalidOperation
-from kimchi.model.config import CapabilitiesModel
-from kimchi.model.vms import DOM_STATE_MAP, VMModel
-from kimchi.xmlutils.interface import get_iface_xml
+from wok.exception import InvalidOperation, MissingParameter
+from wok.exception import NotFoundError, InvalidOperation
+from config import CapabilitiesModel
+from vms import DOM_STATE_MAP, VMModel
+from ..xmlutils.interface import get_iface_xml
class VMIfacesModel(object):
diff --git a/plugins/kimchi/model/vms.py b/plugins/kimchi/model/vms.py
index 106e9bc..a874ca1 100644
--- a/plugins/kimchi/model/vms.py
+++ b/plugins/kimchi/model/vms.py
@@ -29,25 +29,27 @@ from xml.etree import ElementTree
import libvirt
-from kimchi import model, vnc
-from kimchi.config import READONLY_POOL_TYPE, config
-from kimchi.exception import InvalidOperation, InvalidParameter
-from kimchi.exception import NotFoundError, OperationFailed
-from kimchi.kvmusertests import UserTests
-from kimchi.model.config import CapabilitiesModel
-from kimchi.model.tasks import TaskModel
-from kimchi.model.templates import TemplateModel
-from kimchi.model.utils import get_vm_name
-from kimchi.model.utils import get_metadata_node
-from kimchi.model.utils import set_metadata_node
-from kimchi.rollbackcontext import RollbackContext
-from kimchi.screenshot import VMScreenshot
-from kimchi.utils import add_task, convert_data_size, get_next_clone_name
-from kimchi.utils import import_class, kimchi_log, run_setfacl_set_attr
-from kimchi.utils import template_name_from_uri
-from kimchi.xmlutils.cpu import get_cpu_xml, get_numa_xml
-from kimchi.xmlutils.utils import xpath_get_text, xml_item_update
-from kimchi.xmlutils.utils import dictize
+from wok import vnc
+from .. import model
+from wok.config import config
+from ..config import READONLY_POOL_TYPE
+from wok.exception import InvalidOperation, InvalidParameter
+from wok.exception import NotFoundError, OperationFailed
+from ..kvmusertests import UserTests
+from config import CapabilitiesModel
+from tasks import TaskModel
+from templates import TemplateModel
+from utils import get_vm_name
+from utils import get_metadata_node
+from utils import set_metadata_node
+from wok.rollbackcontext import RollbackContext
+from ..screenshot import VMScreenshot
+from wok.utils import add_task, convert_data_size, get_next_clone_name
+from wok.utils import import_class, kimchi_log, run_setfacl_set_attr
+from ..utils import template_name_from_uri
+from ..xmlutils.cpu import get_cpu_xml, get_numa_xml
+from wok.xmlutils.utils import xpath_get_text, xml_item_update
+from wok.xmlutils.utils import dictize
DOM_STATE_MAP = {0: 'nostate',
@@ -182,16 +184,16 @@ class VMModel(object):
self.objstore = kargs['objstore']
self.caps = CapabilitiesModel(**kargs)
self.vmscreenshot = VMScreenshotModel(**kargs)
- self.users = import_class('kimchi.model.users.UsersModel')(**kargs)
- self.groups = import_class('kimchi.model.groups.GroupsModel')(**kargs)
+ self.users =
import_class('plugins.kimchi.model.users.UsersModel')(**kargs)
+ self.groups =
import_class('plugins.kimchi.model.groups.GroupsModel')(**kargs)
self.vms = VMsModel(**kargs)
self.task = TaskModel(**kargs)
self.storagepool = model.storagepools.StoragePoolModel(**kargs)
self.storagevolume = model.storagevolumes.StorageVolumeModel(**kargs)
self.storagevolumes = model.storagevolumes.StorageVolumesModel(**kargs)
- cls = import_class('kimchi.model.vmsnapshots.VMSnapshotModel')
+ cls = import_class('plugins.kimchi.model.vmsnapshots.VMSnapshotModel')
self.vmsnapshot = cls(**kargs)
- cls = import_class('kimchi.model.vmsnapshots.VMSnapshotsModel')
+ cls = import_class('plugins.kimchi.model.vmsnapshots.VMSnapshotsModel')
self.vmsnapshots = cls(**kargs)
self.stats = {}
diff --git a/plugins/kimchi/model/vmsnapshots.py b/plugins/kimchi/model/vmsnapshots.py
index 3a92cdc..60de253 100644
--- a/plugins/kimchi/model/vmsnapshots.py
+++ b/plugins/kimchi/model/vmsnapshots.py
@@ -24,12 +24,12 @@ import lxml.etree as ET
from lxml import objectify
from lxml.builder import E
-from kimchi.exception import InvalidOperation, NotFoundError, OperationFailed
-from kimchi.model.tasks import TaskModel
-from kimchi.model.vms import DOM_STATE_MAP, VMModel
-from kimchi.model.vmstorages import VMStorageModel, VMStoragesModel
-from kimchi.utils import add_task
-from kimchi.xmlutils.utils import xpath_get_text
+from wok.exception import InvalidOperation, NotFoundError, OperationFailed
+from tasks import TaskModel
+from vms import DOM_STATE_MAP, VMModel
+from vmstorages import VMStorageModel, VMStoragesModel
+from wok.utils import add_task
+from wok.xmlutils.utils import xpath_get_text
class VMSnapshotsModel(object):
diff --git a/plugins/kimchi/model/vmstorages.py b/plugins/kimchi/model/vmstorages.py
index 142b177..29f8f30 100644
--- a/plugins/kimchi/model/vmstorages.py
+++ b/plugins/kimchi/model/vmstorages.py
@@ -21,17 +21,17 @@ import string
from lxml import etree
-from kimchi.exception import InvalidOperation, InvalidParameter, NotFoundError
-from kimchi.exception import OperationFailed
-from kimchi.model.config import CapabilitiesModel
-from kimchi.model.vms import DOM_STATE_MAP, VMModel
-from kimchi.model.storagevolumes import StorageVolumeModel
-from kimchi.model.utils import get_vm_config_flag
-from kimchi.osinfo import lookup
-from kimchi.model.diskutils import get_disk_used_by, set_disk_used_by
-from kimchi.utils import kimchi_log
-from kimchi.xmlutils.disk import get_device_node, get_disk_xml
-from kimchi.xmlutils.disk import get_vm_disk_info, get_vm_disks
+from wok.exception import InvalidOperation, InvalidParameter, NotFoundError
+from wok.exception import OperationFailed
+from config import CapabilitiesModel
+from vms import DOM_STATE_MAP, VMModel
+from storagevolumes import StorageVolumeModel
+from utils import get_vm_config_flag
+from ..osinfo import lookup
+from diskutils import get_disk_used_by, set_disk_used_by
+from wok.utils import kimchi_log
+from ..xmlutils.disk import get_device_node, get_disk_xml
+from ..xmlutils.disk import get_vm_disk_info, get_vm_disks
HOTPLUG_TYPE = ['scsi', 'virtio']
diff --git a/plugins/kimchi/osinfo.py b/plugins/kimchi/osinfo.py
index 78eb828..d2aab71 100644
--- a/plugins/kimchi/osinfo.py
+++ b/plugins/kimchi/osinfo.py
@@ -26,7 +26,7 @@ from collections import defaultdict
from configobj import ConfigObj
from distutils.version import LooseVersion
-from kimchi.config import paths
+from wok.config import paths
SUPPORTED_ARCHS = {'x86': ('i386', 'i686', 'x86_64'),
diff --git a/plugins/kimchi/repositories.py b/plugins/kimchi/repositories.py
index 20b7311..926bd45 100644
--- a/plugins/kimchi/repositories.py
+++ b/plugins/kimchi/repositories.py
@@ -24,12 +24,12 @@ import urlparse
from ConfigParser import ConfigParser
-from kimchi.basemodel import Singleton
-from kimchi.config import kimchiLock
-from kimchi.exception import InvalidOperation, InvalidParameter
-from kimchi.exception import OperationFailed, NotFoundError, MissingParameter
-from kimchi.utils import validate_repo_url
-from kimchi.yumparser import get_yum_repositories, write_repo_to_file
+from wok.basemodel import Singleton
+from config import kimchiLock
+from wok.exception import InvalidOperation, InvalidParameter
+from wok.exception import OperationFailed, NotFoundError, MissingParameter
+from wok.utils import validate_repo_url
+from yumparser import get_yum_repositories, write_repo_to_file
class Repositories(object):
diff --git a/plugins/kimchi/scan.py b/plugins/kimchi/scan.py
index 86999b4..8e42fbc 100644
--- a/plugins/kimchi/scan.py
+++ b/plugins/kimchi/scan.py
@@ -26,8 +26,8 @@ import tempfile
import time
-from kimchi.isoinfo import IsoImage, probe_iso
-from kimchi.utils import kimchi_log
+from isoinfo import IsoImage, probe_iso
+from wok.utils import kimchi_log
SCAN_IGNORE = ['/tmp/kimchi-scan-*']
diff --git a/plugins/kimchi/screenshot.py b/plugins/kimchi/screenshot.py
index e599d40..765e1a6 100644
--- a/plugins/kimchi/screenshot.py
+++ b/plugins/kimchi/screenshot.py
@@ -32,8 +32,8 @@ except ImportError:
import Image
-from kimchi import config
-from kimchi.utils import kimchi_log
+import config
+from wok.utils import kimchi_log
(fd, pipe) = tempfile.mkstemp()
diff --git a/plugins/kimchi/swupdate.py b/plugins/kimchi/swupdate.py
index 70db2ef..592fb84 100644
--- a/plugins/kimchi/swupdate.py
+++ b/plugins/kimchi/swupdate.py
@@ -20,11 +20,11 @@
import subprocess
import time
-from kimchi.basemodel import Singleton
-from kimchi.config import kimchiLock
-from kimchi.exception import NotFoundError, OperationFailed
-from kimchi.utils import kimchi_log, run_command
-from kimchi.yumparser import get_yum_packages_list_update
+from wok.basemodel import Singleton
+from config import kimchiLock
+from wok.exception import NotFoundError, OperationFailed
+from wok.utils import kimchi_log, run_command
+from yumparser import get_yum_packages_list_update
class SoftwareUpdate(object):
diff --git a/plugins/kimchi/tests/iso_gen.py b/plugins/kimchi/tests/iso_gen.py
index 096161d..7e92622 100644
--- a/plugins/kimchi/tests/iso_gen.py
+++ b/plugins/kimchi/tests/iso_gen.py
@@ -20,7 +20,7 @@
import platform
import struct
-from kimchi.isoinfo import IsoImage
+from wok.plugins.kimchi.isoinfo import IsoImage
iso_des = [
('openbsd', lambda v: True,
diff --git a/plugins/kimchi/tests/run_tests.sh.in b/plugins/kimchi/tests/run_tests.sh.in
index d1f4b38..beef75e 100644
--- a/plugins/kimchi/tests/run_tests.sh.in
+++ b/plugins/kimchi/tests/run_tests.sh.in
@@ -52,4 +52,4 @@ for ((i=0;i<${#LIST[@]};i++)); do
fi
done
-PYTHONPATH=../src:../ $CMD $OPTS ${MODEL_LIST[@]} ${MOCK_LIST[@]}
+PYTHONPATH=../plugins:../src:../ $CMD $OPTS ${MODEL_LIST[@]} ${MOCK_LIST[@]}
diff --git a/plugins/kimchi/tests/test_authorization.py
b/plugins/kimchi/tests/test_authorization.py
index 959dcf8..6513b67 100644
--- a/plugins/kimchi/tests/test_authorization.py
+++ b/plugins/kimchi/tests/test_authorization.py
@@ -23,7 +23,7 @@ import unittest
from functools import partial
-import kimchi.mockmodel
+from wok.plugins.kimchi import mockmodel
from iso_gen import construct_fake_iso
from utils import get_free_port, patch_auth, request
from utils import run_server, wait_task
@@ -41,7 +41,7 @@ def setUpModule():
global test_server, model, host, port, ssl_port
patch_auth(sudo=False)
- model = kimchi.mockmodel.MockModel('/tmp/obj-store-test')
+ model = mockmodel.MockModel('/tmp/obj-store-test')
host = '127.0.0.1'
port = get_free_port('http')
ssl_port = get_free_port('https')
@@ -123,7 +123,7 @@ class AuthorizationTests(unittest.TestCase):
wait_task(model.task_lookup, task_info['id'])
model.vm_update(u'test-me',
- {'users': [kimchi.mockmodel.fake_user.keys()[0]],
+ {'users': [mockmodel.fake_user.keys()[0]],
'groups': []})
task_info = model.vms_create({'name': u'test-usera',
diff --git a/plugins/kimchi/tests/test_config.py.in
b/plugins/kimchi/tests/test_config.py.in
index 6123f66..337218e 100644
--- a/plugins/kimchi/tests/test_config.py.in
+++ b/plugins/kimchi/tests/test_config.py.in
@@ -19,8 +19,8 @@
import unittest
-from kimchi import config
-from kimchi.config import Paths, PluginPaths, KimchiConfig
+from wok import config
+from wok.config import Paths, PluginPaths, KimchiConfig
get_prefix = None
diff --git a/plugins/kimchi/tests/test_exception.py
b/plugins/kimchi/tests/test_exception.py
index a533015..834a275 100644
--- a/plugins/kimchi/tests/test_exception.py
+++ b/plugins/kimchi/tests/test_exception.py
@@ -22,8 +22,8 @@ import os
import unittest
-import kimchi.mockmodel
-import kimchi.server
+from wok.plugins.kimchi import mockmodel
+import wok.server
from utils import get_free_port, patch_auth, request, run_server
@@ -38,7 +38,7 @@ def setup_server(environment='development'):
global test_server, model, host, port, ssl_port
patch_auth()
- model = kimchi.mockmodel.MockModel('/tmp/obj-store-test')
+ model = mockmodel.MockModel('/tmp/obj-store-test')
host = '127.0.0.1'
port = get_free_port('http')
ssl_port = get_free_port('https')
diff --git a/plugins/kimchi/tests/test_host.py b/plugins/kimchi/tests/test_host.py
index 1273457..7770148 100644
--- a/plugins/kimchi/tests/test_host.py
+++ b/plugins/kimchi/tests/test_host.py
@@ -28,7 +28,7 @@ import unittest
from functools import partial
-from kimchi.mockmodel import MockModel
+from wok.plugins.kimchi.mockmodel import MockModel
from utils import get_free_port, patch_auth, request, run_server, wait_task
test_server = None
diff --git a/plugins/kimchi/tests/test_mock_network.py
b/plugins/kimchi/tests/test_mock_network.py
index 4416c04..4e390b1 100644
--- a/plugins/kimchi/tests/test_mock_network.py
+++ b/plugins/kimchi/tests/test_mock_network.py
@@ -24,7 +24,7 @@ import unittest
from functools import partial
-from kimchi.mockmodel import MockModel
+from wok.plugins.kimchi.mockmodel import MockModel
from test_model_network import _do_network_test
from utils import get_free_port, patch_auth, request, run_server
diff --git a/plugins/kimchi/tests/test_mock_storagepool.py
b/plugins/kimchi/tests/test_mock_storagepool.py
index 1dc9277..c72708b 100644
--- a/plugins/kimchi/tests/test_mock_storagepool.py
+++ b/plugins/kimchi/tests/test_mock_storagepool.py
@@ -24,7 +24,7 @@ import unittest
from functools import partial
-from kimchi.mockmodel import MockModel
+from wok.plugins.kimchi.mockmodel import MockModel
from utils import get_free_port, patch_auth, request, run_server
diff --git a/plugins/kimchi/tests/test_mock_storagevolume.py
b/plugins/kimchi/tests/test_mock_storagevolume.py
index f59aa13..3dd16b7 100644
--- a/plugins/kimchi/tests/test_mock_storagevolume.py
+++ b/plugins/kimchi/tests/test_mock_storagevolume.py
@@ -24,7 +24,7 @@ import unittest
from functools import partial
-from kimchi.mockmodel import MockModel
+from wok.plugins.kimchi.mockmodel import MockModel
from test_model_storagevolume import _do_volume_test
from utils import get_free_port, patch_auth, request, run_server
diff --git a/plugins/kimchi/tests/test_mockmodel.py
b/plugins/kimchi/tests/test_mockmodel.py
index 52972f0..03ad445 100644
--- a/plugins/kimchi/tests/test_mockmodel.py
+++ b/plugins/kimchi/tests/test_mockmodel.py
@@ -24,9 +24,9 @@ import time
import unittest
-import kimchi.mockmodel
+from wok.plugins.kimchi import mockmodel
from utils import get_free_port, patch_auth, request, run_server, wait_task
-from kimchi.osinfo import get_template_default
+from wok.plugins.kimchi.osinfo import get_template_default
test_server = None
@@ -40,7 +40,7 @@ fake_iso = None
def setUpModule():
global host, port, ssl_port, model, test_server, fake_iso
cherrypy.request.headers = {'Accept': 'application/json'}
- model = kimchi.mockmodel.MockModel('/tmp/obj-store-test')
+ model = mockmodel.MockModel('/tmp/obj-store-test')
patch_auth()
port = get_free_port('http')
ssl_port = get_free_port('https')
diff --git a/plugins/kimchi/tests/test_model.py b/plugins/kimchi/tests/test_model.py
index 3828342..7f90274 100644
--- a/plugins/kimchi/tests/test_model.py
+++ b/plugins/kimchi/tests/test_model.py
@@ -29,18 +29,18 @@ import uuid
import iso_gen
-import kimchi.objectstore
+import wok.objectstore
import utils
-from kimchi import netinfo
-from kimchi.basemodel import Singleton
-from kimchi.config import config
-from kimchi.exception import InvalidOperation
-from kimchi.exception import InvalidParameter, NotFoundError, OperationFailed
-from kimchi.osinfo import get_template_default
-from kimchi.model import model
-from kimchi.model.libvirtconnection import LibvirtConnection
-from kimchi.rollbackcontext import RollbackContext
-from kimchi.utils import add_task
+from wok import netinfo
+from wok.basemodel import Singleton
+from wok.config import config
+from wok.exception import InvalidOperation
+from wok.exception import InvalidParameter, NotFoundError, OperationFailed
+from wok.plugins.kimchi.osinfo import get_template_default
+from wok.plugins.kimchi.model import model
+from wok.plugins.kimchi.model.libvirtconnection import LibvirtConnection
+from wok.rollbackcontext import RollbackContext
+from wok.utils import add_task
invalid_repository_urls = ['www.fedora.org', # missing protocol
@@ -1217,7 +1217,7 @@ class BaseModelTests(unittest.TestCase):
def get_list(self):
return list(self.data)
- class TestModel(kimchi.basemodel.BaseModel):
+ class TestModel(wok.basemodel.BaseModel):
def __init__(self):
foo = BaseModelTests.FoosModel()
super(BaseModelTests.TestModel, self).__init__([foo])
diff --git a/plugins/kimchi/tests/test_model_network.py
b/plugins/kimchi/tests/test_model_network.py
index 5dbe54d..d557b3c 100644
--- a/plugins/kimchi/tests/test_model_network.py
+++ b/plugins/kimchi/tests/test_model_network.py
@@ -24,8 +24,8 @@ import unittest
from functools import partial
-from kimchi.model.model import Model
-from kimchi.rollbackcontext import RollbackContext
+from wok.plugins.kimchi.model.model import Model
+from wok.rollbackcontext import RollbackContext
from utils import get_free_port, patch_auth, request, rollback_wrapper
from utils import run_server
diff --git a/plugins/kimchi/tests/test_model_storagepool.py
b/plugins/kimchi/tests/test_model_storagepool.py
index eabf875..a01adc0 100644
--- a/plugins/kimchi/tests/test_model_storagepool.py
+++ b/plugins/kimchi/tests/test_model_storagepool.py
@@ -24,8 +24,8 @@ import unittest
from functools import partial
-from kimchi.model.model import Model
-from kimchi.rollbackcontext import RollbackContext
+from wok.plugins.kimchi.model.model import Model
+from wok.rollbackcontext import RollbackContext
from utils import get_free_port, patch_auth, request
from utils import run_server
diff --git a/plugins/kimchi/tests/test_model_storagevolume.py
b/plugins/kimchi/tests/test_model_storagevolume.py
index 5e76d3d..d47b4e3 100644
--- a/plugins/kimchi/tests/test_model_storagevolume.py
+++ b/plugins/kimchi/tests/test_model_storagevolume.py
@@ -25,10 +25,11 @@ import unittest
from functools import partial
-from kimchi.config import paths, READONLY_POOL_TYPE
-from kimchi.model.model import Model
-from kimchi.mockmodel import MockModel
-from kimchi.rollbackcontext import RollbackContext
+from wok.config import paths
+from wok.plugins.kimchi.config import READONLY_POOL_TYPE
+from wok.plugins.kimchi.model.model import Model
+from wok.plugins.kimchi.mockmodel import MockModel
+from wok.rollbackcontext import RollbackContext
from utils import fake_auth_header, get_free_port, patch_auth, request
from utils import rollback_wrapper, run_server, wait_task
diff --git a/plugins/kimchi/tests/test_networkxml.py
b/plugins/kimchi/tests/test_networkxml.py
index 3706a71..139f051 100644
--- a/plugins/kimchi/tests/test_networkxml.py
+++ b/plugins/kimchi/tests/test_networkxml.py
@@ -23,8 +23,8 @@ import lxml.etree as ET
import utils
-from kimchi.xmlutils import network as nxml
-from kimchi.xmlutils.utils import xpath_get_text
+from wok.plugins.kimchi.xmlutils import network as nxml
+from wok.xmlutils.utils import xpath_get_text
class NetworkXmlTests(unittest.TestCase):
diff --git a/plugins/kimchi/tests/test_objectstore.py
b/plugins/kimchi/tests/test_objectstore.py
index f62217e..412a7f2 100644
--- a/plugins/kimchi/tests/test_objectstore.py
+++ b/plugins/kimchi/tests/test_objectstore.py
@@ -23,8 +23,8 @@ import tempfile
import threading
import unittest
-from kimchi.exception import NotFoundError
-from kimchi import objectstore
+from wok.exception import NotFoundError
+from wok import objectstore
tmpfile = None
diff --git a/plugins/kimchi/tests/test_osinfo.py b/plugins/kimchi/tests/test_osinfo.py
index e617c54..1712ded 100644
--- a/plugins/kimchi/tests/test_osinfo.py
+++ b/plugins/kimchi/tests/test_osinfo.py
@@ -20,8 +20,8 @@
import unittest
-from kimchi.osinfo import _get_arch, get_template_default, lookup
-from kimchi.osinfo import modern_version_bases
+from wok.plugins.kimchi.osinfo import _get_arch, get_template_default, lookup
+from wok.plugins.kimchi.osinfo import modern_version_bases
class OSInfoTests(unittest.TestCase):
diff --git a/plugins/kimchi/tests/test_plugin.py b/plugins/kimchi/tests/test_plugin.py
index 9eb6e0a..2f2475a 100644
--- a/plugins/kimchi/tests/test_plugin.py
+++ b/plugins/kimchi/tests/test_plugin.py
@@ -25,9 +25,9 @@ import unittest
from functools import partial
-import kimchi.mockmodel
-import kimchi.server
-from kimchi.utils import get_enabled_plugins
+from wok.plugins.kimchi import mockmodel
+import wok.server
+from wok.utils import get_enabled_plugins
import utils
@@ -42,7 +42,7 @@ def setUpModule():
global test_server, model, host, port, ssl_port
utils.patch_auth()
- model = kimchi.mockmodel.MockModel('/tmp/obj-store-test')
+ model = mockmodel.MockModel('/tmp/obj-store-test')
host = '127.0.0.1'
port = utils.get_free_port('http')
ssl_port = utils.get_free_port('https')
diff --git a/plugins/kimchi/tests/test_rest.py b/plugins/kimchi/tests/test_rest.py
index c2d142f..f390abb 100644
--- a/plugins/kimchi/tests/test_rest.py
+++ b/plugins/kimchi/tests/test_rest.py
@@ -29,11 +29,11 @@ import urlparse
from functools import partial
import iso_gen
-import kimchi.mockmodel
-import kimchi.server
-from kimchi.osinfo import get_template_default
-from kimchi.rollbackcontext import RollbackContext
-from kimchi.utils import add_task
+from wok.plugins.kimchi import mockmodel
+import wok.server
+from wok.plugins.kimchi.osinfo import get_template_default
+from wok.rollbackcontext import RollbackContext
+from wok.utils import add_task
from utils import get_free_port, patch_auth, request
from utils import run_server, wait_task
@@ -51,7 +51,7 @@ def setUpModule():
global test_server, model, host, port, ssl_port, cherrypy_port
patch_auth()
- model = kimchi.mockmodel.MockModel('/tmp/obj-store-test')
+ model = mockmodel.MockModel('/tmp/obj-store-test')
host = '127.0.0.1'
port = get_free_port('http')
ssl_port = get_free_port('https')
diff --git a/plugins/kimchi/tests/test_rollbackcontext.py
b/plugins/kimchi/tests/test_rollbackcontext.py
index 1492d33..6eac6d0 100644
--- a/plugins/kimchi/tests/test_rollbackcontext.py
+++ b/plugins/kimchi/tests/test_rollbackcontext.py
@@ -19,7 +19,7 @@
import unittest
-from kimchi.rollbackcontext import RollbackContext
+from wok.rollbackcontext import RollbackContext
class FirstError(Exception):
diff --git a/plugins/kimchi/tests/test_server.py b/plugins/kimchi/tests/test_server.py
index a4d31d0..228a9b5 100644
--- a/plugins/kimchi/tests/test_server.py
+++ b/plugins/kimchi/tests/test_server.py
@@ -28,8 +28,8 @@ import unittest
from functools import partial
import utils
-from kimchi import mockmodel
-from kimchi.control.base import Collection, Resource
+from wok.plugins.kimchi import mockmodel
+from wok.control.base import Collection, Resource
test_server = None
model = None
diff --git a/plugins/kimchi/tests/test_storagepoolxml.py
b/plugins/kimchi/tests/test_storagepoolxml.py
index c508c58..7e45cca 100644
--- a/plugins/kimchi/tests/test_storagepoolxml.py
+++ b/plugins/kimchi/tests/test_storagepoolxml.py
@@ -20,7 +20,7 @@
import lxml.etree as ET
import unittest
-from kimchi.model.libvirtstoragepool import StoragePoolDef
+from wok.plugins.kimchi.model.libvirtstoragepool import StoragePoolDef
class StoragepoolXMLTests(unittest.TestCase):
diff --git a/plugins/kimchi/tests/test_template.py
b/plugins/kimchi/tests/test_template.py
index acdb7c6..b263b63 100644
--- a/plugins/kimchi/tests/test_template.py
+++ b/plugins/kimchi/tests/test_template.py
@@ -24,8 +24,8 @@ import unittest
from functools import partial
-from kimchi.config import READONLY_POOL_TYPE
-from kimchi.mockmodel import MockModel
+from wok.plugins.kimchi.config import READONLY_POOL_TYPE
+from wok.plugins.kimchi.mockmodel import MockModel
from utils import get_free_port, patch_auth, request, run_server
diff --git a/plugins/kimchi/tests/test_utils.py b/plugins/kimchi/tests/test_utils.py
index b8ff621..bcb14e2 100644
--- a/plugins/kimchi/tests/test_utils.py
+++ b/plugins/kimchi/tests/test_utils.py
@@ -19,8 +19,8 @@
import unittest
-from kimchi.exception import InvalidParameter
-from kimchi.utils import convert_data_size
+from wok.exception import InvalidParameter
+from wok.utils import convert_data_size
class UtilsTests(unittest.TestCase):
diff --git a/plugins/kimchi/tests/test_vmtemplate.py
b/plugins/kimchi/tests/test_vmtemplate.py
index 0ca9adb..6213900 100644
--- a/plugins/kimchi/tests/test_vmtemplate.py
+++ b/plugins/kimchi/tests/test_vmtemplate.py
@@ -22,9 +22,9 @@ import unittest
import uuid
-from kimchi.osinfo import get_template_default
-from kimchi.vmtemplate import VMTemplate
-from kimchi.xmlutils.utils import xpath_get_text
+from wok.plugins.kimchi.osinfo import get_template_default
+from wok.plugins.kimchi.vmtemplate import VMTemplate
+from wok.xmlutils.utils import xpath_get_text
class VMTemplateTests(unittest.TestCase):
diff --git a/plugins/kimchi/tests/test_yumparser.py
b/plugins/kimchi/tests/test_yumparser.py
index 69f411a..8dd16b0 100644
--- a/plugins/kimchi/tests/test_yumparser.py
+++ b/plugins/kimchi/tests/test_yumparser.py
@@ -21,12 +21,12 @@ import os
import tempfile
import unittest
-from kimchi.model import model
-from kimchi.rollbackcontext import RollbackContext
-from kimchi.yumparser import delete_repo_from_file, get_repo_files
-from kimchi.yumparser import get_yum_packages_list_update
-from kimchi.yumparser import get_yum_repositories, write_repo_to_file
-from kimchi.yumparser import YumRepoObject
+from wok.plugins.kimchi.model import model
+from wok.rollbackcontext import RollbackContext
+from wok.plugins.kimchi.yumparser import delete_repo_from_file, get_repo_files
+from wok.plugins.kimchi.yumparser import get_yum_packages_list_update
+from wok.plugins.kimchi.yumparser import get_yum_repositories, write_repo_to_file
+from wok.plugins.kimchi.yumparser import YumRepoObject
TEMP_REPO_FILE = ''
diff --git a/plugins/kimchi/tests/utils.py b/plugins/kimchi/tests/utils.py
index 2ffe776..6144dc7 100644
--- a/plugins/kimchi/tests/utils.py
+++ b/plugins/kimchi/tests/utils.py
@@ -36,12 +36,12 @@ from contextlib import closing
from lxml import etree
-import kimchi.mockmodel
-import kimchi.server
-from kimchi.config import config, paths
-from kimchi.auth import User, USER_NAME, USER_GROUPS, USER_ROLES, tabs
-from kimchi.exception import NotFoundError, OperationFailed
-from kimchi.utils import kimchi_log
+from wok.plugins.kimchi import mockmodel
+import wok.server
+from wok.config import config, paths
+from wok.auth import User, USER_NAME, USER_GROUPS, USER_ROLES, tabs
+from wok.exception import NotFoundError, OperationFailed
+from wok.utils import kimchi_log
_ports = {}
@@ -118,7 +118,7 @@ def run_server(host, port, ssl_port, test_mode, cherrypy_port=None,
if model is not None:
setattr(args, 'model', model)
- s = kimchi.server.Server(args)
+ s = wok.server.Server(args)
t = threading.Thread(target=s.start)
t.setDaemon(True)
t.start()
@@ -142,7 +142,7 @@ def _request(conn, path, data, method, headers):
headers = {'Content-Type': 'application/json',
'Accept': 'application/json'}
if 'AUTHORIZATION' not in headers.keys():
- user, pw = kimchi.mockmodel.fake_user.items()[0]
+ user, pw = mockmodel.fake_user.items()[0]
hdr = "Basic " + base64.b64encode("%s:%s" % (user, pw))
headers['AUTHORIZATION'] = hdr
conn.request(method, path, data, headers)
@@ -203,7 +203,7 @@ class FakeUser(User):
@staticmethod
def authenticate(username, password, service="passwd"):
try:
- return kimchi.mockmodel.fake_user[username] == password
+ return mockmodel.fake_user[username] == password
except KeyError, e:
raise OperationFailed("KCHAUTH0001E", {'username':
'username',
'code': e.message})
@@ -254,7 +254,7 @@ def rollback_wrapper(func, resource, *args):
# requests lib take care of encode part, so use this lib instead
def fake_auth_header():
headers = {'Accept': 'application/json'}
- user, pw = kimchi.mockmodel.fake_user.items()[0]
+ user, pw = mockmodel.fake_user.items()[0]
hdr = "Basic " + base64.b64encode("%s:%s" % (user, pw))
headers['AUTHORIZATION'] = hdr
return headers
diff --git a/plugins/kimchi/ui/pages/error.html.tmpl
b/plugins/kimchi/ui/pages/error.html.tmpl
index d8e16e6..068f2a6 100644
--- a/plugins/kimchi/ui/pages/error.html.tmpl
+++ b/plugins/kimchi/ui/pages/error.html.tmpl
@@ -18,7 +18,7 @@
#encoding UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/guest-add.html.tmpl
b/plugins/kimchi/ui/pages/guest-add.html.tmpl
index ab26c1e..8466bae 100644
--- a/plugins/kimchi/ui/pages/guest-add.html.tmpl
+++ b/plugins/kimchi/ui/pages/guest-add.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/guest-storage-add.html.tmpl
b/plugins/kimchi/ui/pages/guest-storage-add.html.tmpl
index 504316c..a26e0f9 100644
--- a/plugins/kimchi/ui/pages/guest-storage-add.html.tmpl
+++ b/plugins/kimchi/ui/pages/guest-storage-add.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/guest.html.tmpl
b/plugins/kimchi/ui/pages/guest.html.tmpl
index a192413..a876f38 100644
--- a/plugins/kimchi/ui/pages/guest.html.tmpl
+++ b/plugins/kimchi/ui/pages/guest.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/i18n.json.tmpl
b/plugins/kimchi/ui/pages/i18n.json.tmpl
index f705613..cd320e0 100644
--- a/plugins/kimchi/ui/pages/i18n.json.tmpl
+++ b/plugins/kimchi/ui/pages/i18n.json.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/report-add.html.tmpl
b/plugins/kimchi/ui/pages/report-add.html.tmpl
index e63da44..ecfb1a0 100644
--- a/plugins/kimchi/ui/pages/report-add.html.tmpl
+++ b/plugins/kimchi/ui/pages/report-add.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/report-rename.html.tmpl
b/plugins/kimchi/ui/pages/report-rename.html.tmpl
index 5bc91d3..ca17982 100644
--- a/plugins/kimchi/ui/pages/report-rename.html.tmpl
+++ b/plugins/kimchi/ui/pages/report-rename.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/repository-add.html.tmpl
b/plugins/kimchi/ui/pages/repository-add.html.tmpl
index 6de4f76..5b1208e 100644
--- a/plugins/kimchi/ui/pages/repository-add.html.tmpl
+++ b/plugins/kimchi/ui/pages/repository-add.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/repository-edit.html.tmpl
b/plugins/kimchi/ui/pages/repository-edit.html.tmpl
index f13cb90..616cbc0 100644
--- a/plugins/kimchi/ui/pages/repository-edit.html.tmpl
+++ b/plugins/kimchi/ui/pages/repository-edit.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/storagepool-add-volume.html.tmpl
b/plugins/kimchi/ui/pages/storagepool-add-volume.html.tmpl
index 048f1ed..8099006 100644
--- a/plugins/kimchi/ui/pages/storagepool-add-volume.html.tmpl
+++ b/plugins/kimchi/ui/pages/storagepool-add-volume.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/tabs/guests.html.tmpl
b/plugins/kimchi/ui/pages/tabs/guests.html.tmpl
index 7bbf570..b96dd21 100644
--- a/plugins/kimchi/ui/pages/tabs/guests.html.tmpl
+++ b/plugins/kimchi/ui/pages/tabs/guests.html.tmpl
@@ -19,7 +19,7 @@
#unicode UTF-8
#import gettext
#from Cheetah.Template import Template
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/tabs/host.html.tmpl
b/plugins/kimchi/ui/pages/tabs/host.html.tmpl
index d5a9b1d..921b45f 100644
--- a/plugins/kimchi/ui/pages/tabs/host.html.tmpl
+++ b/plugins/kimchi/ui/pages/tabs/host.html.tmpl
@@ -18,7 +18,7 @@
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/tabs/network.html.tmpl
b/plugins/kimchi/ui/pages/tabs/network.html.tmpl
index 6eaa4b3..421f6bc 100644
--- a/plugins/kimchi/ui/pages/tabs/network.html.tmpl
+++ b/plugins/kimchi/ui/pages/tabs/network.html.tmpl
@@ -18,7 +18,7 @@
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/tabs/templates.html.tmpl
b/plugins/kimchi/ui/pages/tabs/templates.html.tmpl
index 4f91254..cd9b8e5 100644
--- a/plugins/kimchi/ui/pages/tabs/templates.html.tmpl
+++ b/plugins/kimchi/ui/pages/tabs/templates.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/template-add.html.tmpl
b/plugins/kimchi/ui/pages/template-add.html.tmpl
index 58cb20f..fe63283 100644
--- a/plugins/kimchi/ui/pages/template-add.html.tmpl
+++ b/plugins/kimchi/ui/pages/template-add.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/ui/pages/template-edit.html.tmpl
b/plugins/kimchi/ui/pages/template-edit.html.tmpl
index 5191f54..fa6ebd3 100644
--- a/plugins/kimchi/ui/pages/template-edit.html.tmpl
+++ b/plugins/kimchi/ui/pages/template-edit.html.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/plugins/kimchi/vmtemplate.py b/plugins/kimchi/vmtemplate.py
index 79e04ed..f45f80d 100644
--- a/plugins/kimchi/vmtemplate.py
+++ b/plugins/kimchi/vmtemplate.py
@@ -26,17 +26,18 @@ import uuid
from lxml import etree
from lxml.builder import E
-from kimchi import imageinfo
-from kimchi import osinfo
-from kimchi.exception import InvalidParameter, IsoFormatError, MissingParameter
-from kimchi.exception import ImageFormatError, OperationFailed
-from kimchi.isoinfo import IsoImage
-from kimchi.utils import check_url_path, pool_name_from_uri
-from kimchi.xmlutils.cpu import get_cpu_xml
-from kimchi.xmlutils.disk import get_disk_xml
-from kimchi.xmlutils.graphics import get_graphics_xml
-from kimchi.xmlutils.interface import get_iface_xml
-from kimchi.xmlutils.qemucmdline import get_qemucmdline_xml
+import imageinfo
+import osinfo
+from wok.exception import InvalidParameter, IsoFormatError, MissingParameter
+from wok.exception import ImageFormatError, OperationFailed
+from isoinfo import IsoImage
+from wok.utils import check_url_path
+from utils import pool_name_from_uri
+from xmlutils.cpu import get_cpu_xml
+from xmlutils.disk import get_disk_xml
+from xmlutils.graphics import get_graphics_xml
+from xmlutils.interface import get_iface_xml
+from xmlutils.qemucmdline import get_qemucmdline_xml
class VMTemplate(object):
diff --git a/plugins/kimchi/xmlutils/disk.py b/plugins/kimchi/xmlutils/disk.py
index 64e243a..a451c43 100644
--- a/plugins/kimchi/xmlutils/disk.py
+++ b/plugins/kimchi/xmlutils/disk.py
@@ -27,8 +27,8 @@ import urlparse
from lxml import objectify
from lxml.builder import E
-from kimchi.exception import InvalidParameter, NotFoundError
-from kimchi.utils import check_url_path
+from wok.exception import InvalidParameter, NotFoundError
+from wok.utils import check_url_path
BUS_TO_DEV_MAP = {'ide': 'hd', 'virtio': 'vd',
'scsi': 'sd'}
DEV_TYPE_SRC_ATTR_MAP = {'file': 'file', 'block': 'dev'}
diff --git a/plugins/kimchi/xmlutils/interface.py b/plugins/kimchi/xmlutils/interface.py
index 82ac505..70b63bd 100644
--- a/plugins/kimchi/xmlutils/interface.py
+++ b/plugins/kimchi/xmlutils/interface.py
@@ -22,7 +22,7 @@ import lxml.etree as ET
from distutils.version import LooseVersion
from lxml.builder import E
-from kimchi import osinfo
+from .. import osinfo
def get_iface_xml(params, arch=None, os_distro=None, os_version=None):
diff --git a/plugins/sample/__init__.py b/plugins/sample/__init__.py
index 10c244c..d741ddb 100644
--- a/plugins/sample/__init__.py
+++ b/plugins/sample/__init__.py
@@ -24,9 +24,9 @@ import os
from cherrypy import expose
-from kimchi.config import PluginPaths
-from kimchi.control.base import Collection, Resource
-from kimchi.root import Root
+from wok.config import PluginPaths
+from wok.control.base import Collection, Resource
+from wok.root import Root
from plugins.sample.i18n import messages
from plugins.sample.model import Model
diff --git a/plugins/sample/model.py b/plugins/sample/model.py
index ce43761..8edcc85 100644
--- a/plugins/sample/model.py
+++ b/plugins/sample/model.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.exception import InvalidOperation, NotFoundError
-from kimchi.basemodel import BaseModel
+from wok.exception import InvalidOperation, NotFoundError
+from wok.basemodel import BaseModel
class CirclesModel(object):
diff --git a/plugins/sample/sample.conf.in b/plugins/sample/sample.conf.in
index ac7e27f..28ae891 100644
--- a/plugins/sample/sample.conf.in
+++ b/plugins/sample/sample.conf.in
@@ -24,4 +24,4 @@ tools.kimchiauth.on = True
[/help]
tools.staticdir.on = True
tools.nocache.on = True
-tools.staticdir.dir = kimchi.config.PluginPaths('sample').ui_dir +
'/pages/help'
+tools.staticdir.dir = wok.config.PluginPaths('sample').ui_dir +
'/pages/help'
diff --git a/plugins/sample/ui/pages/i18n.json.tmpl
b/plugins/sample/ui/pages/i18n.json.tmpl
index ed9b66f..737bb39 100644
--- a/plugins/sample/ui/pages/i18n.json.tmpl
+++ b/plugins/sample/ui/pages/i18n.json.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/src/wok/asynctask.py b/src/wok/asynctask.py
index b5673b2..1e0ec4b 100644
--- a/src/wok/asynctask.py
+++ b/src/wok/asynctask.py
@@ -22,7 +22,7 @@ import threading
import traceback
-from kimchi.exception import OperationFailed
+from wok.exception import OperationFailed
class AsyncTask(object):
diff --git a/src/wok/auth.py b/src/wok/auth.py
index 1a52185..6bd1566 100644
--- a/src/wok/auth.py
+++ b/src/wok/auth.py
@@ -30,10 +30,10 @@ import termios
import time
import urllib2
-from kimchi import template
-from kimchi.config import config
-from kimchi.exception import InvalidOperation, OperationFailed
-from kimchi.utils import get_all_tabs, run_command
+from wok import template
+from wok.config import config
+from wok.exception import InvalidOperation, OperationFailed
+from wok.utils import get_all_tabs, run_command
USER_NAME = 'username'
USER_GROUPS = 'groups'
diff --git a/src/wok/cachebust.py b/src/wok/cachebust.py
index e2e2c9f..d7cf111 100644
--- a/src/wok/cachebust.py
+++ b/src/wok/cachebust.py
@@ -20,7 +20,7 @@
import os
-from kimchi.config import paths
+from wok.config import paths
def href(url):
diff --git a/src/wok/control/__init__.py b/src/wok/control/__init__.py
index 98d42d3..4ad9459 100644
--- a/src/wok/control/__init__.py
+++ b/src/wok/control/__init__.py
@@ -20,7 +20,7 @@
import os
-from kimchi.control.utils import load_url_sub_node
+from wok.control.utils import load_url_sub_node
sub_nodes = load_url_sub_node(os.path.dirname(__file__), __name__)
diff --git a/src/wok/control/base.py b/src/wok/control/base.py
index 006a6f7..d926a63 100644
--- a/src/wok/control/base.py
+++ b/src/wok/control/base.py
@@ -22,14 +22,14 @@ import re
import urllib2
-import kimchi.template
-from kimchi.auth import USER_GROUPS, USER_NAME, USER_ROLES
-from kimchi.control.utils import get_class_name, internal_redirect, model_fn
-from kimchi.control.utils import parse_request, validate_method
-from kimchi.control.utils import validate_params
-from kimchi.exception import InvalidOperation, InvalidParameter
-from kimchi.exception import KimchiException, MissingParameter, NotFoundError
-from kimchi.exception import OperationFailed, UnauthorizedError
+import wok.template
+from wok.auth import USER_GROUPS, USER_NAME, USER_ROLES
+from wok.control.utils import get_class_name, internal_redirect, model_fn
+from wok.control.utils import parse_request, validate_method
+from wok.control.utils import validate_params
+from wok.exception import InvalidOperation, InvalidParameter
+from wok.exception import KimchiException, MissingParameter, NotFoundError
+from wok.exception import OperationFailed, UnauthorizedError
class Resource(object):
@@ -90,7 +90,7 @@ class Resource(object):
def generate_action_handler_task(self, action_name, action_args=None):
def _render_task(self, task):
cherrypy.response.status = 202
- return kimchi.template.render('Task', task)
+ return wok.template.render('Task', task)
return self._generate_action_handler_base(action_name, _render_task,
action_args=action_args)
@@ -213,7 +213,7 @@ class Resource(object):
def get(self):
self.lookup()
- return kimchi.template.render(get_class_name(self), self.data)
+ return wok.template.render(get_class_name(self), self.data)
@property
def data(self):
@@ -314,7 +314,7 @@ class Collection(object):
flag_filter, fields_filter = _split_filter(filter_params)
resources = self._get_resources(flag_filter)
data = self.filter_data(resources, fields_filter)
- return kimchi.template.render(get_class_name(self), data)
+ return wok.template.render(get_class_name(self), data)
@cherrypy.expose
def index(self, *args, **kwargs):
@@ -361,7 +361,7 @@ class AsyncCollection(Collection):
args = self.model_args + [params]
task = create(*args)
cherrypy.response.status = 202
- return kimchi.template.render("Task", task)
+ return wok.template.render("Task", task)
class SimpleCollection(Collection):
@@ -378,4 +378,4 @@ class SimpleCollection(Collection):
res_list = get_list(*self.model_args)
except AttributeError:
pass
- return kimchi.template.render(get_class_name(self), res_list)
+ return wok.template.render(get_class_name(self), res_list)
diff --git a/src/wok/control/plugins.py b/src/wok/control/plugins.py
index 39fd851..1cc1d5a 100644
--- a/src/wok/control/plugins.py
+++ b/src/wok/control/plugins.py
@@ -17,8 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.control.base import SimpleCollection
-from kimchi.control.utils import UrlSubNode
+from wok.control.base import SimpleCollection
+from wok.control.utils import UrlSubNode
@UrlSubNode("plugins")
diff --git a/src/wok/control/utils.py b/src/wok/control/utils.py
index d26fe48..d617dcd 100644
--- a/src/wok/control/utils.py
+++ b/src/wok/control/utils.py
@@ -25,9 +25,9 @@ import json
from jsonschema import Draft3Validator, ValidationError, FormatChecker
-from kimchi.auth import USER_ROLES
-from kimchi.exception import InvalidParameter, OperationFailed
-from kimchi.utils import import_module, listPathModules
+from wok.auth import USER_ROLES
+from wok.exception import InvalidParameter, OperationFailed
+from wok.utils import import_module, listPathModules
def get_class_name(cls):
diff --git a/src/wok/exception.py b/src/wok/exception.py
index 039152a..f41028b 100644
--- a/src/wok/exception.py
+++ b/src/wok/exception.py
@@ -21,8 +21,8 @@ import cherrypy
import gettext
-from kimchi.i18n import messages as _messages
-from kimchi.template import get_lang, validate_language
+from wok.i18n import messages as _messages
+from wok.template import get_lang, validate_language
class KimchiException(Exception):
diff --git a/src/wok/model/plugins.py b/src/wok/model/plugins.py
index 1b4d21b..e350f1e 100644
--- a/src/wok/model/plugins.py
+++ b/src/wok/model/plugins.py
@@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from kimchi.utils import get_enabled_plugins
+from wok.utils import get_enabled_plugins
class PluginsModel(object):
diff --git a/src/wok/objectstore.py b/src/wok/objectstore.py
index 3e91a26..7c2a5cc 100644
--- a/src/wok/objectstore.py
+++ b/src/wok/objectstore.py
@@ -28,9 +28,9 @@ except ImportError:
from ordereddict import OrderedDict
-from kimchi import config
-from kimchi.exception import NotFoundError
-from kimchi.utils import kimchi_log
+from wok import config
+from wok.exception import NotFoundError
+from wok.utils import kimchi_log
class ObjectStoreSession(object):
diff --git a/src/wok/proxy.py b/src/wok/proxy.py
index 5dcca65..1c46c11 100644
--- a/src/wok/proxy.py
+++ b/src/wok/proxy.py
@@ -27,8 +27,8 @@ import pwd
import subprocess
from string import Template
-from kimchi import sslcert
-from kimchi.config import paths
+from wok import sslcert
+from wok.config import paths
def _create_proxy_config(options):
diff --git a/src/wok/root.py b/src/wok/root.py
index cd338d9..a3b8be1 100644
--- a/src/wok/root.py
+++ b/src/wok/root.py
@@ -23,14 +23,14 @@ import os
from distutils.version import LooseVersion
-from kimchi import auth
-from kimchi import template
-from kimchi.i18n import messages
-from kimchi.config import paths
-from kimchi.control import sub_nodes
-from kimchi.control.base import Resource
-from kimchi.control.utils import parse_request
-from kimchi.exception import MissingParameter, OperationFailed
+from wok import auth
+from wok import template
+from wok.i18n import messages
+from wok.config import paths
+from wok.control import sub_nodes
+from wok.control.base import Resource
+from wok.control.utils import parse_request
+from wok.exception import MissingParameter, OperationFailed
class Root(Resource):
diff --git a/src/wok/server.py b/src/wok/server.py
index eb58465..5394d24 100644
--- a/src/wok/server.py
+++ b/src/wok/server.py
@@ -23,16 +23,16 @@ import logging
import logging.handlers
import os
-from kimchi import auth
-from kimchi import config
-from kimchi.model import model
-from kimchi import mockmodel
-from kimchi import vnc
-from kimchi.config import KimchiConfig, PluginConfig
-from kimchi.control import sub_nodes
-from kimchi.proxy import start_proxy, terminate_proxy
-from kimchi.root import KimchiRoot
-from kimchi.utils import get_enabled_plugins, import_class
+from wok import auth
+from wok import config
+from wok.model import model
+from wok import mockmodel
+from wok import vnc
+from wok.config import KimchiConfig, PluginConfig
+from wok.control import sub_nodes
+from wok.proxy import start_proxy, terminate_proxy
+from wok.root import KimchiRoot
+from wok.utils import get_enabled_plugins, import_class
LOGGING_LEVEL = {"debug": logging.DEBUG,
diff --git a/src/wok/template.py b/src/wok/template.py
index aaba0c9..46c0f3c 100644
--- a/src/wok/template.py
+++ b/src/wok/template.py
@@ -22,7 +22,7 @@ import errno
import json
-from kimchi.config import paths
+from wok.config import paths
from Cheetah.Template import Template
from glob import iglob
diff --git a/src/wok/utils.py b/src/wok/utils.py
index ff3a5da..d8ad25f 100644
--- a/src/wok/utils.py
+++ b/src/wok/utils.py
@@ -35,9 +35,9 @@ from threading import Timer
from urlparse import urlparse
from cherrypy.lib.reprconf import Parser
-from kimchi.asynctask import AsyncTask
-from kimchi.config import paths, PluginPaths
-from kimchi.exception import InvalidParameter, TimeoutExpired
+from wok.asynctask import AsyncTask
+from wok.config import paths, PluginPaths
+from wok.exception import InvalidParameter, TimeoutExpired
kimchi_log = cherrypy.log.error_log
diff --git a/src/wok/vnc.py b/src/wok/vnc.py
index b4194b1..e50e9f2 100644
--- a/src/wok/vnc.py
+++ b/src/wok/vnc.py
@@ -25,7 +25,7 @@ import os
from multiprocessing import Process
from websockify import WebSocketProxy
-from kimchi.config import config, paths
+from wok.config import config, paths
WS_TOKENS_DIR = '/var/lib/kimchi/vnc-tokens'
diff --git a/src/wokd.in b/src/wokd.in
index 4ea7a42..62a8504 100644
--- a/src/wokd.in
+++ b/src/wokd.in
@@ -25,8 +25,8 @@ sys.path.insert(1, '@pythondir@')
from optparse import OptionParser
-import kimchi.server
-import kimchi.config as config
+import wok.server
+import wok.config as config
if not config.paths.installed:
@@ -93,7 +93,7 @@ def main(options):
setattr(options, 'max_body_size',
config.config.get('server', 'max_body_size'))
- kimchi.server.main(options)
+ wok.server.main(options)
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
diff --git a/ui/pages/error.html.tmpl b/ui/pages/error.html.tmpl
index d8e16e6..068f2a6 100644
--- a/ui/pages/error.html.tmpl
+++ b/ui/pages/error.html.tmpl
@@ -18,7 +18,7 @@
#encoding UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
index f705613..cd320e0 100644
--- a/ui/pages/i18n.json.tmpl
+++ b/ui/pages/i18n.json.tmpl
@@ -17,7 +17,7 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
diff --git a/ui/pages/login.html.tmpl b/ui/pages/login.html.tmpl
index e2f6855..e13e03d 100644
--- a/ui/pages/login.html.tmpl
+++ b/ui/pages/login.html.tmpl
@@ -17,12 +17,12 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
#silent next = "?next=%s" % $getVar('data.next', '') if
$getVar('data.next', '') else ""
-#from kimchi.config import get_version
+#from wok.config import get_version
<!DOCTYPE html>
<html lang="$lang.lang[0]">
<head>
diff --git a/ui/pages/wok-ui.html.tmpl b/ui/pages/wok-ui.html.tmpl
index 8da8acc..23e6875 100644
--- a/ui/pages/wok-ui.html.tmpl
+++ b/ui/pages/wok-ui.html.tmpl
@@ -17,11 +17,11 @@
*#
#unicode UTF-8
#import gettext
-#from kimchi.cachebust import href
+#from wok.cachebust import href
#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang,
fallback=True)
#silent _ = t.gettext
#silent _t = t.gettext
-#from kimchi.config import get_version
+#from wok.config import get_version
<!DOCTYPE html>
<html lang="$lang.lang[0]">
<head>
--
1.7.1