
On 08/05/2015 10:59 AM, Lucio Correia wrote:
On 08/05/2015 09:31 AM, Aline Manera wrote:
On 10/07/2015 18:12, Lucio Correia wrote:
The modules network and netinfo are specific to kimchi. This patch moves them from wok to kimchi plugin and adapts the respective imports.
Signed-off-by: Lucio Correia <luciojhc@linux.vnet.ibm.com> --- plugins/kimchi/model/host.py | 2 +- plugins/kimchi/model/interfaces.py | 2 +- plugins/kimchi/model/networks.py | 4 ++-- {src/wok => plugins/kimchi}/netinfo.py | 0 {src/wok => plugins/kimchi}/network.py | 0 plugins/kimchi/tests/test_model.py | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename {src/wok => plugins/kimchi}/netinfo.py (100%) rename {src/wok => plugins/kimchi}/network.py (100%)
diff --git a/plugins/kimchi/model/host.py b/plugins/kimchi/model/host.py index 3ff034c..8c891a1 100644 --- a/plugins/kimchi/model/host.py +++ b/plugins/kimchi/model/host.py @@ -25,7 +25,6 @@ import time from cherrypy.process.plugins import BackgroundTask from collections import defaultdict
-from wok import netinfo from wok.basemodel import Singleton from wok.exception import InvalidOperation, InvalidParameter from wok.exception import NotFoundError, OperationFailed @@ -34,6 +33,7 @@ from wok.xmlutils.utils import xpath_get_text
import hostdev from .. import disks +from .. import netinfo
Why are we not using the full import path?
from wok.plugins.kimchi import netinfo
This patch is based on Wok V3, which will probably need to have that fixed as well.
I will resend this patch as soon as those fixes get on top of Wok V3.
Change of plans. We will keep relative imports due to kimchi layout. From PEP8: However, explicit relative imports are an acceptable alternative to absolute imports, especially when dealing with complex package layouts where using absolute imports would be unnecessarily verbose: from . import sibling from .sibling import example So no change are being provided to this patchset, unless there are additional review comments. -- Lucio Correia Software Engineer IBM LTC Brazil