Setting Up OpenStack Python Client Development Environment

Publicado em: 20 Janeiro 2015
no canal de: Nucleus
2,685
2

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...


Nesta página do site você pode assistir ao vídeo on-line Setting Up OpenStack Python Client Development Environment duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Nucleus 20 Janeiro 2015, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 2,685 vezes e gostou 2 espectadores. Boa visualização!