avocado-framework / avocado-vt

Avocado VT Plugin
https://avocado-vt.readthedocs.org/
Other
83 stars 242 forks source link

couldn't use "from utils_test import libvirt" from libvirt_vm.py #798

Open balamuruhans opened 7 years ago

balamuruhans commented 7 years ago

From libvirt_vm.py I am trying to use a method in libvirt.py, but importing "from .utils_test import libvirt" causing error as

Failed to load plugin from module "avocado_vt.plugins.vt_list": ImportError('cannot import name libvirt_vm',) Failed to load plugin from module "avocado_vt.plugins.vt": ImportError('cannot import name qemu',)

@Hao-Liu @will-Do can you help me here

will-Do commented 7 years ago

@balamuruhans Seems you add a redundant '.' in the import statement, should be: from utils_test import libvirt And for avoiding the confusion with official libvirt python binding package, we can name this module, such as: from utils_test import libvirt as utils_libvirt

will-Do commented 7 years ago

Oh, please ignore the last comment. The reason is it form an import loop, like: libvirt_vm -> utils_test/libvirt -> utilstest/__init_\ -> env_process -> libvirt_vm

balamuruhans commented 7 years ago

okay, I will change the flow for my work.

@will-Do, Thanks for your time.