Setting Up OpenStack Python Client Development Environment
http://fosshelp.blogspot.in/2014/12/s...
1)
Clone the Project
#git clone https://github.com/openstack/python-k...
2)
Goto cloned directory
#cd python-keystoneclient
3)
Setup the Environment
3,a)
With run_tests.sh
#./run_tests.sh
OR
3,b)
With tox
#sudo pip install tox
#tox
4)
Run the client commands
4,a)
With run_tests.sh Environment
4,a,a)Goto cloned directory
#cd python-keystoneclient
4,a,b)
Create a script named "keystone" with following statements in cloned directory.
#vim keystone
#!/usr/bin/python
PBR Generated from 'console_scripts'
import sys
from keystoneclient.shell import main
if _name_ == "__main__":
sys.exit(main())
4,a,c)
Run the keystone client commands from run_tests.sh Environment
#source .venv/bin/activate
#.venv/bin/python keystone tenant-list
#.venv/bin/python keystone user-list
OR
4,b)
With Tox Environment
4,b,a)
Goto cloned directory
#cd python-keystoneclient
4,b,b)
Create a script named "keystone" with following statements in cloned directory.
#vim keystone
#!/usr/bin/python
PBR Generated from 'console_scripts'
import sys
from keystoneclient.shell import main
if _name_ == "__main__":
sys.exit(main())
4,b,c)
Run the keystone client commands from Tox Environment
#source .tox/py27/bin/activate
#.tox/py27/bin/python keystone tenant-list
#.tox/py27/bin/python keystone user-list
5)
Run the Tests
5,a)
With run_tests.sh
#./run_tests.sh --debug keystoneclient.tests.v2_0.test_tenants.TenantTests.test_list
##Only pep8 test
#./run_tests.sh --debug --pep8 keystoneclient.tests.v2_0.test_tenants
##manual pep8 test with the wrapper flake8
#source .venv/bin/activate
#flake8 keystoneclient/tests/v2_0/test_tenants.py
OR
5,b)
With tox
Deactivate virtualenv (Important), then run tox command , otherwise tox command will try to recreate the virtualenv from scratch
#deactivate
*UnitTest
#tox -e py27 -- keystoneclient.tests.v2_0.test_tenants.TenantTests.test_list
#tox -e py27 -- keystoneclient.tests.v2_0.test_tenants
#tox -e py27
*pep8 test
#tox -e pep8 -- keystoneclient.tests.v2_0.test_tenants
#tox -e pep8
http://fosshelp.blogspot.in/2014/11/o...
Sur cette page du site, vous pouvez voir la vidéo en ligne Setting Up OpenStack Python Client Development Environment durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Nucleus 20 janvier 2015, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 2,685 fois et il a aimé 2 téléspectateurs. Bon visionnage!