Ask Your Question

adding custom module path to cinder's path

asked 2014-02-20 06:36:13 -0500

parash_hallur gravatar image

I want to be able to add my custom python modules path to cinder's path. I know that by adding the custom path to PYTHONPATH, it will work. Given that each service is running as a screen, how would I set each scree's PYTHONPATH without entering into the screen.

Following is what I want to do Keep my custom python modules in say .../custom_modules/ Now from the cinder driver code, I want to be able to do "import"

The PYTHONPATH I set is valid as long as I'm not entered into the screen, once I attach to screen, the PYTHONPATH I had set is no longer valid, as that would be new shell. Please let me know if there is a way to do it?

Thanks, Parash

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-02-24 05:05:16 -0500

unmesh-gurjar gravatar image

From the user account which you run the screens, edit the ~/.bashrc file and add something like 'export PYTHONPATH=$PYTHONPATH:/my/custom/module/path'. That should make it available the next time you run the screens!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-02-20 06:36:13 -0500

Seen: 348 times

Last updated: Feb 24 '14