Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic: mgr/PyModule: put mgr_module_path first in sys.path #26777

Merged
merged 1 commit into from May 2, 2019

Conversation

Projects
None yet
4 participants
@pdvian
Copy link

commented Mar 6, 2019

mgr/PyModule: put mgr_module_path first in sys.path
If the various python site packages appear first in sys.path, and there
happens to be a package whose name is the same as an mgr module, mgr will
try to load that thing instead of the expected mgr module.  This results
in a very terse couple of errors:

  mgr[py] Class not found in module 'deepsea'
  mgr[py] Error loading module 'deepsea': (22) Invalid argument

Before this commit, sys.path on my SLE 11 SP1 dev system is:

  /usr/lib/python36.zip
  /usr/lib64/python3.6
  /usr/lib64/python3.6
  /usr/lib64/python3.6/lib-dynload
  /usr/lib64/python3.6/site-packages
  /usr/lib/python3.6/site-packages
  /usr/local/lib64/python3.6/site-packages
  /usr/local/lib/python3.6/site-packages
  /usr/lib64/ceph/mgr

After this commit, /usr/share/ceph/mgr comes before python's site-packages,
and everything works properly:

  /usr/lib/python36.zip
  /usr/lib64/python3.6
  /usr/lib64/python3.6
  /usr/lib64/python3.6/lib-dynload
  /usr/share/ceph/mgr
  /usr/lib64/python3.6/site-packages
  /usr/lib/python3.6/site-packages
  /usr/local/lib64/python3.6/site-packages
  /usr/local/lib/python3.6/site-packages

(If you're interested in seeing what's in sys.path, turn "debug mgr" up
to at least 10, then grep the logs for "Computed sys.path")

Fixes: https://tracker.ceph.com/issues/38469
Signed-off-by: Tim Serong <tserong@suse.com>
(cherry picked from commit 7e34b27)

Conflicts:
	src/mgr/PyModule.cc : Resolved in load

@smithfarm smithfarm requested a review from tserong Mar 6, 2019

@smithfarm smithfarm added the mgr label Mar 6, 2019

@smithfarm smithfarm added this to the mimic milestone Mar 6, 2019

@tserong

tserong approved these changes Mar 7, 2019

@smithfarm

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

jenkins re-test this please

@smithfarm

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

jenkins test docs

@yuriw

This comment has been minimized.

Copy link
Contributor

commented May 1, 2019

@yuriw yuriw merged commit e5cc8eb into ceph:mimic May 2, 2019

4 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.