Using it from manage
when some file has missing library import inside it the error message is not clear.
# robottelo.decorators.func_locker
from pytest_services.locks import file_lock
# pytest_services x is not installed
# so the following error message should be more clear about it.
@localhost(rob63) :~/P/robottelo|masterâš¡?
➤ manage shell 12:41:26
Traceback (most recent call last):
File "/home/brocha/.virtualenvs/rob63/bin/manage", line 11, in <module>
sys.exit(main())
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/manage/cli.py", line 235, in main
return manager()
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/manage/cli.py", line 196, in shell
MANAGE_DICT
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/manage/cli.py", line 108, in create_shell
auto_imported = import_objects(manage_dict)
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/manage/auto_import.py", line 57, in import_objects
import_submodules(name)
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/manage/auto_import.py", line 21, in import_submodules
import_string('{0}.{1}'.format(name, item[1]))
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/import_string/base.py", line 61, in import_string
sys.exc_info()[2])
File "/home/brocha/.virtualenvs/rob63/lib/python2.7/site-packages/import_string/base.py", line 54, in import_string
raise ImportError(e)
import_string.base.ImportStringError: import_string() failed for 'robottelo.decorators.func_locker'. Possible reasons are:
- missing __init__.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;
Debugged import:
- 'robottelo' found in './robottelo/__init__.py'.
- 'robottelo.decorators' found in './robottelo/decorators/__init__.py'.
- 'robottelo.decorators.func_locker' not found.
Original exception:
ImportError: 'module' object has no attribute 'func_locker'