[autotest]Not able to import module from newly created directory |
|||
Issue descriptionI have a tarball and some python files that the server side tests would need. I tried to create directory under cros/network/packet_gen and put my files there. But the test failed to import module from this directory. Also tried creating a parallel dir under cros itself that also failed to import. All goes well if i put my files without creating a dir. But i would like to put them under one dir because the are conceptually related. Is there a reason why i can't create new directory under these existing autotest directors ?
,
Sep 29 2016
Yes, i import through autotest_lib. I created a common.py in the new dir, but still throws module error. 16:26:56 INFO | autoserv| from autotest_lib.server.cros.packet_generation import IP_utils 16:26:56 INFO | autoserv| ImportError: No module named packet_generation
,
Sep 29 2016
Contents of common.py same as https://cs.corp.google.com/chromeos_public/src/third_party/autotest/files/server/cros/ap_configurators/common.py
,
Sep 29 2016
Seems there is a mismatch: cros/network/packet_gen autotest_lib.server.cros.packet_generation import IP_utils What's the new directory exactly?
,
Sep 29 2016
The new dir is server/cros/packet_generation, imported as "from autotest_lib.server.cros.packet_generation import IP_utils". It contains a file with helper methods and files that will be copied over to the router.
,
Sep 29 2016
check if there is any pyc files in server/cros/packet_generation, delete them. Upload the cl so one can try to reproduce it.
,
Sep 30 2016
CL uploaded here https://chromium-review.googlesource.com/#/c/391215/
,
Oct 12 2016
Is this issue still outstanding?
,
Oct 12 2016
The issue is resolved. Was able to import after creating the common.py and __init__.py files in that dir. |
|||
►
Sign in to add a comment |
|||
Comment 1 by dshi@chromium.org
, Sep 29 2016