Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
mockmodel.py | 3 ++-
model/storagepools.py | 3 ++-
model/storagevolumes.py | 7 ++++---
model/vmhostdevs.py | 3 ++-
model/vms.py | 5 +++--
model/vmsnapshots.py | 2 +-
tests/test_model.py | 7 ++++---
tests/test_rest.py | 2 +-
8 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/mockmodel.py b/mockmodel.py
index cd06ee3..29b6cf5 100644
--- a/mockmodel.py
+++ b/mockmodel.py
@@ -28,9 +28,10 @@ from collections import defaultdict
from lxml import objectify
from lxml.builder import E
+from wok.asynctask import add_task
from wok.exception import NotFoundError, OperationFailed
from wok.objectstore import ObjectStore
-from wok.utils import add_task, convert_data_size
+from wok.utils import convert_data_size
from wok.xmlutils.utils import xml_item_update
from wok.plugins.kimchi import imageinfo
diff --git a/model/storagepools.py b/model/storagepools.py
index a2dbaec..b6527bb 100644
--- a/model/storagepools.py
+++ b/model/storagepools.py
@@ -21,9 +21,10 @@ import libvirt
import lxml.etree as ET
from lxml.builder import E
+from wok.asynctask import add_task
from wok.exception import InvalidOperation, MissingParameter
from wok.exception import NotFoundError, OperationFailed
-from wok.utils import add_task, run_command, wok_log
+from wok.utils import run_command, wok_log
from wok.xmlutils.utils import xpath_get_text
from wok.plugins.kimchi.config import config, get_kimchi_version, kimchiPaths
diff --git a/model/storagevolumes.py b/model/storagevolumes.py
index 7b2272b..f25beae 100644
--- a/model/storagevolumes.py
+++ b/model/storagevolumes.py
@@ -28,12 +28,13 @@ import time
import urllib2
from lxml.builder import E
+from wok.asynctask import add_task
from wok.exception import InvalidOperation, InvalidParameter, IsoFormatError
from wok.exception import MissingParameter, NotFoundError, OperationFailed
-from wok.utils import add_task, get_unique_file_name
-from wok.utils import probe_file_permission_as_user, wok_log
-from wok.xmlutils.utils import xpath_get_text
from wok.model.tasks import TaskModel
+from wok.utils import get_unique_file_name, probe_file_permission_as_user
+from wok.utils import wok_log
+from wok.xmlutils.utils import xpath_get_text
from wok.plugins.kimchi.config import READONLY_POOL_TYPE
from wok.plugins.kimchi.isoinfo import IsoImage
diff --git a/model/vmhostdevs.py b/model/vmhostdevs.py
index ef39de3..e39afc7 100644
--- a/model/vmhostdevs.py
+++ b/model/vmhostdevs.py
@@ -26,12 +26,13 @@ from lxml import etree, objectify
from lxml.builder import E, ElementMaker
from operator import itemgetter
+from wok.asynctask import add_task
from wok.exception import InvalidOperation, InvalidParameter, NotFoundError
from wok.exception import OperationFailed
from wok.message import WokMessage
from wok.model.tasks import TaskModel
from wok.rollbackcontext import RollbackContext
-from wok.utils import add_task, run_command, wok_log
+from wok.utils import run_command, wok_log
from wok.plugins.kimchi.model.config import CapabilitiesModel
from wok.plugins.kimchi.model.host import DeviceModel, DevicesModel
diff --git a/model/vms.py b/model/vms.py
index 3380278..164f086 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -34,13 +34,14 @@ from lxml import etree, objectify
from lxml.builder import E
from xml.etree import ElementTree
+from wok.asynctask import add_task
from wok.config import config
from wok.exception import InvalidOperation, InvalidParameter
from wok.exception import NotFoundError, OperationFailed
from wok.model.tasks import TaskModel
from wok.rollbackcontext import RollbackContext
-from wok.utils import add_task, convert_data_size
-from wok.utils import import_class, run_setfacl_set_attr, run_command, wok_log
+from wok.utils import convert_data_size, import_class, run_command
+from wok.utils import run_setfacl_set_attr, wok_log
from wok.xmlutils.utils import dictize, xpath_get_text, xml_item_insert
from wok.xmlutils.utils import xml_item_remove, xml_item_update
diff --git a/model/vmsnapshots.py b/model/vmsnapshots.py
index 6f2483c..6852bdc 100644
--- a/model/vmsnapshots.py
+++ b/model/vmsnapshots.py
@@ -23,8 +23,8 @@ import time
from lxml import objectify
from lxml.builder import E
+from wok.asynctask import add_task
from wok.exception import InvalidOperation, NotFoundError, OperationFailed
-from wok.utils import add_task
from wok.xmlutils.utils import xpath_get_text
from wok.model.tasks import TaskModel
diff --git a/tests/test_model.py b/tests/test_model.py
index e77d4fd..77906ba 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -33,15 +33,15 @@ import unittest
from mock import call, mock_open, patch
-import tests.utils as utils
-
import wok.objectstore
+
+from wok.asynctask import add_task
from wok.basemodel import Singleton
from wok.config import config
from wok.exception import InvalidOperation
from wok.exception import InvalidParameter, NotFoundError, OperationFailed
from wok.rollbackcontext import RollbackContext
-from wok.utils import add_task, convert_data_size, get_task_id
+from wok.utils import convert_data_size, get_task_id
from wok.xmlutils.utils import xpath_get_text
from wok.plugins.gingerbase import netinfo
@@ -54,6 +54,7 @@ from wok.plugins.kimchi.model.virtviewerfile import
VMVirtViewerFileModel
from wok.plugins.kimchi.model.vms import VMModel
import iso_gen
+import tests.utils as utils
invalid_repository_urls = ['www.fedora.org', # missing protocol
diff --git a/tests/test_rest.py b/tests/test_rest.py
index 80596c2..e2e3518 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -30,8 +30,8 @@ from functools import partial
from tests.utils import get_free_port, patch_auth, request
from tests.utils import run_server, wait_task
+from wok.asynctask import add_task
from wok.rollbackcontext import RollbackContext
-from wok.utils import add_task
from wok.plugins.kimchi import mockmodel
from wok.plugins.kimchi.osinfo import get_template_default
--
1.9.1