Ask Your Question
1

Installation of devstack on RHEL

asked 2013-10-08 07:08:35 -0600

Ninad gravatar image

Hi.

I am trying to install devstack on RHEL 6. When I run stack.sh, it prints some line and ends after giving error. I think I have resolved all required dependancies. Here is the error log.

...
...
+ sudo rm -rf /tmp/pip-build.a4yNk
++ python -c 'import site; import os; print os.linesep.join(site.getsitepackages())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getsitepackages'
+ SITE_DIRS=
++ failed
++ local r=1
+++ jobs -p
++ kill
++ set +o xtrace
-bash-4.1$

Please help.

Thanks,

Ninad.

edit retag flag offensive close merge delete

Comments

1

I think it's because RHEL6 uses Python version 2.6. The getsitepackages method is only available from Python version 2.7 and higher. The script that calls the method is devstack/tools/fixup_stuff.sh has some hacks for RHEL6, but this isn't one of them.

dkanbier gravatar imagedkanbier ( 2013-10-08 08:52:48 -0600 )edit

I came to know about it. I installed Python 2.7. But Still my red hat uses python 2.6. Even I copied & replaced site.py, site.pyc & site.pyo files from Python 2.7 to Python 2.6 files (& I didn't take backup of Python 2.6 files...). But it didn't work.

Ninad gravatar imageNinad ( 2013-10-09 00:32:48 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
3

answered 2013-10-08 09:17:49 -0600

larsks gravatar image

As dkanbier said, Python on RHEL6 does not have the site.getsitepackages method. I think if you replace:

SITE_DIRS=$(python -c "import site; import os; print os.linesep.join(site.getsitepackages())")

With:

SITE_DIRS=$(
    python -c "import sys; import site; import os; print (hasattr(site, 'getsitepackages') and os.linesep.join(site.getsitepackages()) or os.linesep.join(sys.path))"
)

That you'll end up with something that does the right thing.

edit flag offensive delete link more

Comments

Thanks for reply. But in which file I need to replace? Because I was trying to run stack.sh. I checked it for above.

Ninad gravatar imageNinad ( 2013-10-09 00:35:39 -0600 )edit

hey thanks..! I changed it. And now above mentioned error is not displayed. but now am getting new error. The new error is: + sudo chmod +r '/usr/lib/python2.6/site-packages/prettytable-0.7.2*/*' chmod: cannot access `/usr/lib/python2.6/site-packages/prettytable-0.7.2*/*': No such file or directory ++ failed

Ninad gravatar imageNinad ( 2013-10-09 03:10:19 -0600 )edit

I think this is because RHEL6.4 uses python2.6 and devstack requires python2.7. I am not sure.

Ninad gravatar imageNinad ( 2013-10-09 03:15:52 -0600 )edit
1

answered 2013-10-16 14:27:43 -0600

Louis Brooks gravatar image

updated 2013-10-16 14:30:14 -0600

Hi Ninad, Not sure if you have solved this yet or not but I had the same problem.

I replaced:

SITE_DIRS=$(python -c "import site; import os; print os.linesep.join(site.getsitepackages())")

with:

SITE_DIRS=$(python -c "import sys; import site; import os; print (hasattr(site, 'getsitepackages') and os.linesep.join(site.getsitepackages()) or os.linesep.join(sys.path))")

in tools/fixup_stuff.sh and got the:

 + sudo chmod +r '/usr/lib/python2.6/site-packages/prettytable-0.7.2*/*' chmod: cannot access `/usr/lib/python2.6/site-packages/prettytable-0.7.2*/*':

error.

All I done to resolve this error was to go to /usr/lib/python2.6/site-packages and find the directory of the prettytable package my python implementation was using (in my case prettytable-0.6.1) and replace the following code in tools/fixup_stuff.sh:

if [[ -r $dir/prettytable.py ]]; then
        sudo chmod +r $dir/prettytable-0.7.2*/*

with:

if [[ -r $dir/prettytable.py ]]; then
    sudo chmod +r $dir/prettytable-0.6.1*/*

Obviously this isn't a fix but it was all I needed to do to get a running OpenStack implementation. I would say you are probably right with regards to Python being at an older verion being the issue...

edit flag offensive delete link more

Comments

Hey Louis.. Thanks alot for help.. It worked..! One more thing, after editing as per your instruction my RHEL got restarted. This was because of the "sudo service messagebus restart" in fixup_stuff.sh . I commented that, and now will try for stack.sh. Thanks again.

Ninad gravatar imageNinad ( 2013-10-17 01:39:39 -0600 )edit

It worked. But again with new issue..! During execution of stack.sh, it started flooding rsyslog messages to terminal window. Now am unable to do anything on terminal. Can't even restart cinder or nova service. If I stop rsyslog service then those services got failed. Trying to solve..

Ninad gravatar imageNinad ( 2013-10-18 03:41:18 -0600 )edit

Done with the issue.. In localrc file, change SYSLOG=False. This will solve the issue. Thanks allot Louis, Larsks and Dkanbier for the help.

Ninad gravatar imageNinad ( 2013-10-22 05:08:10 -0600 )edit

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

Stats

Asked: 2013-10-08 07:08:35 -0600

Seen: 1,756 times

Last updated: Oct 16 '13