Rally plugins can't use relative imports

Bug #1446923 reported by Boris Pavlovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rally
Fix Released
High
Boris Pavlovic

Bug Description

Let's assume that we have next structure in plugins dir.

To reproduce:

   |-- ~/.rally/plugins

   |---- ~/.rally/plugins/some.py

   |---- ~/.rally/plugins/some2.py

If we try to import in some some2 like:

   import some2

It will raise error:

2015-04-22 03:35:48.741 32297 WARNING rally.common.utils [-] Failed to load module with plugins /Users/boris/.rally/plugins/some.py: No module named some2

 To fix this we should add to sys.path path to dir with plugins

Changed in rally:
status: New → Confirmed
status: Confirmed → Triaged
importance: Undecided → High
assignee: nobody → Boris Pavlovic (boris-42)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to rally (master)

Fix proposed to branch: master
Review: https://review.openstack.org/176153

Changed in rally:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to rally (master)

Reviewed: https://review.openstack.org/176153
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=6bb572e046e4090a3a979440dcafd3d9b9e712b1
Submitter: Jenkins
Branch: master

commit 6bb572e046e4090a3a979440dcafd3d9b9e712b1
Author: Boris Pavlovic <email address hidden>
Date: Wed Apr 22 04:25:03 2015 +0300

    Fix rally plugins relative imports

    We are not able to use relative imports for plugins that are
    outside of rally package.

    To fix this we should add to sys.path all directories with Rally
    plugins.

    This is quite easy fix. But in any case it includes functional test
    that checks that this actually works in real life.

    + Fix of Rally gates to copy whole tree not just *.py files from
      rally-jobs/plugins/

    Change-Id: Ie53dc2ba5c32a5e83d84d0ea5703e2e04b10ff33
    Closes-bug: #1446923

Changed in rally:
status: In Progress → Fix Committed
Changed in rally:
milestone: none → 0.0.4
Changed in rally:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.