I installed and configured glance to try openstack grizzly. I followed the instruction from Grizzly install manual.
When I tried to create an image, I encountered the error and this was the error:
$ sudo glance image-create --name="tty-linux-kernel" --disk-format=aki --container-format=aki < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz Traceback (most recent call last): File "/usr/bin/glance", line 5, in <module> from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2711, in <module> parse_requirements(__requires__), Environment() File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: requests>=0.8.8
Glance has dependencies on other modules, for example, python-swiftclient, python-keystoneclient and so on.
Even, python-swiftclient which installed here has dependencies on its own.
In order to get a clue to solve the error, I printed the command "glance"
$ cat /usr/bin/glance #!/usr/bin/python # EASY-INSTALL-ENTRY-SCRIPT: 'python-glanceclient==0.9.0','console_scripts','glance' __requires__ = 'python-glanceclient==0.9.0' import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.exit( load_entry_point('python-glanceclient==0.9.0', 'console_scripts', 'glance')() )
It seemed that it was something wrong with modules related to "python-glanceclient". Next, I looked at /usr/lib/python2.7/dist-packages/python_glanceclient-0.9.0.egg-info/requires.txt file.
requires.txt fie is used to write a list of packages to install.
$ vi /usr/lib/python2.7/dist-packages/python_glanceclient-0.9.0.egg-info/requires.txt prettytable&gh;=0.6,<0.8 python-keystoneclient>=0.2.3 pyOpenSSL warlock>=0.7.0,<2
But, there was NO module named "requests" in here, so I tried to do other files which were indicated here. I opened the next file, requires.txt for keystoneclient.
$ vi /usr/lib/python2.7/dist-packages/python_keystoneclient-0.2.3.egg-info/requires.txt iso8601>=0.1.4 prettytable requests>=0.8.8 simplejson oslo.config>=1.1.0
I finally found "request" in here and I checked the version of my request module to compare the version number.
$ sudo dpkg -l | grep request ii python-requests 0.8.2-1 elegant and simple HTTP library for Python, built for human beings
My python-requests module was 0.8.2. I changed it into:
$ vi /usr/lib/python2.7/dist-packages/python_keystoneclient-0.2.3.egg-info/requires.txt iso8601>=0.1.4 prettytable requests>=0.8.2 simplejson oslo.config>=1.1.0
I was able to solve my problem by doing this. However, I got another problem with this.
$ sudo glance image-create --name="tty-linux-kernel" --disk-format=aki --container-format=aki --file=ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz Authorization Failed: request() got an unexpected keyword argument 'verify'
This was caused because I had old-dated "python-requests", I needed to install 0.8.8 or higher to work "verify". I found how to solve from the site: https://answers.launchpad.net/keystone/+question/218143
"this duo to you OS has a low version of python-requests by defalut,now python-keystoneclient require a python-requests>0.8.8,<1.0 this bug has been fixed to master. you can first git pull the lastest python-keystoneclient code. then run pip install -r tools/pip-requires."I downloaded new version of it from https://pypi.python.org/pypi/requests/1.2.0
$ sudo tar -xzvf ./requests-1.2.0.tar.gz $ cd requests-1.2.0 $ sudo ./setup.py build
Finally it worked.