From ffa7a582e5bc252eebd5952e3d34e089c810cf61 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Fri, 27 Jun 2014 18:18:47 +0900 Subject: [PATCH] rename neutron to tacker Change-Id: I89e4126cdddcf91c6b375b898c06773941db2a9c --- .coveragerc | 4 +- .gitignore | 6 +- .gitreview | 2 +- README.rst | 2 +- neutron_test.sh | 128 ---------------------------------- openstack-common.conf | 2 +- setup.cfg | 6 +- tacker_test.sh | 20 ++++++ tools/neutron.bash_completion | 27 ------- tools/tacker.bash_completion | 27 +++++++ 10 files changed, 58 insertions(+), 166 deletions(-) delete mode 100755 neutron_test.sh create mode 100755 tacker_test.sh delete mode 100644 tools/neutron.bash_completion create mode 100644 tools/tacker.bash_completion diff --git a/.coveragerc b/.coveragerc index 83f3102c..b387bbf7 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,7 @@ [run] branch = True -source = neutronclient -omit = neutronclient/openstack/*,neutronclient/tests/* +source = tackerclient +omit = tackerclient/openstack/*,tackerclient/tests/* [report] ignore-errors = True diff --git a/.gitignore b/.gitignore index 42921e01..4bcc61a2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,9 +9,9 @@ build-stamp cover/* doc/build/ doc/source/api/ -python_neutronclient.egg-info/* -neutron/vcsversion.py -neutronclient/versioninfo +python_tackerclient.egg-info/* +tacker/vcsversion.py +tackerclient/versioninfo run_tests.err.log run_tests.log .autogenerated diff --git a/.gitreview b/.gitreview index 994b07a4..acab1b0b 100644 --- a/.gitreview +++ b/.gitreview @@ -1,4 +1,4 @@ [gerrit] host=review.openstack.org port=29418 -project=openstack/python-neutronclient.git +project=openstack/python-tackerclient.git diff --git a/README.rst b/README.rst index ea8e44c8..897fff4d 100644 --- a/README.rst +++ b/README.rst @@ -1 +1 @@ -This is the client API library for Neutron. +This is the client API library for Tacker. diff --git a/neutron_test.sh b/neutron_test.sh deleted file mode 100755 index 53aee7cf..00000000 --- a/neutron_test.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/bash -set -x -function die() { - local exitcode=$? - set +o xtrace - echo $@ - exit $exitcode -} - -noauth_tenant_id=me -if [ $1 == 'noauth' ]; then - NOAUTH="--tenant_id $noauth_tenant_id" -else - NOAUTH= -fi - -FORMAT=" --request-format xml" - -# test the CRUD of network -network=mynet1 -neutron net-create $FORMAT $NOAUTH $network || die "fail to create network $network" -temp=`neutron net-list $FORMAT -- --name $network --fields id | wc -l` -echo $temp -if [ $temp -ne 5 ]; then - die "networks with name $network is not unique or found" -fi -network_id=`neutron net-list -- --name $network --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2` -echo "ID of network with name $network is $network_id" - -neutron net-show $FORMAT $network || die "fail to show network $network" -neutron net-show $FORMAT $network_id || die "fail to show network $network_id" - -neutron net-update $FORMAT $network --admin_state_up False || die "fail to update network $network" -neutron net-update $FORMAT $network_id --admin_state_up True || die "fail to update network $network_id" - -neutron net-list $FORMAT -c id -- --id fakeid || die "fail to list networks with column selection on empty list" - -# test the CRUD of subnet -subnet=mysubnet1 -cidr=10.0.1.3/24 -neutron subnet-create $FORMAT $NOAUTH $network $cidr --name $subnet || die "fail to create subnet $subnet" -tempsubnet=`neutron subnet-list $FORMAT -- --name $subnet --fields id | wc -l` -echo $tempsubnet -if [ $tempsubnet -ne 5 ]; then - die "subnets with name $subnet is not unique or found" -fi -subnet_id=`neutron subnet-list $FORMAT -- --name $subnet --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2` -echo "ID of subnet with name $subnet is $subnet_id" -neutron subnet-show $FORMAT $subnet || die "fail to show subnet $subnet" -neutron subnet-show $FORMAT $subnet_id || die "fail to show subnet $subnet_id" - -neutron subnet-update $FORMAT $subnet --dns_namesevers host1 || die "fail to update subnet $subnet" -neutron subnet-update $FORMAT $subnet_id --dns_namesevers host2 || die "fail to update subnet $subnet_id" - -# test the crud of ports -port=myport1 -neutron port-create $FORMAT $NOAUTH $network --name $port || die "fail to create port $port" -tempport=`neutron port-list $FORMAT -- --name $port --fields id | wc -l` -echo $tempport -if [ $tempport -ne 5 ]; then - die "ports with name $port is not unique or found" -fi -port_id=`neutron port-list $FORMAT -- --name $port --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2` -echo "ID of port with name $port is $port_id" -neutron port-show $FORMAT $port || die "fail to show port $port" -neutron port-show $FORMAT $port_id || die "fail to show port $port_id" - -neutron port-update $FORMAT $port --device_id deviceid1 || die "fail to update port $port" -neutron port-update $FORMAT $port_id --device_id deviceid2 || die "fail to update port $port_id" - -# test quota commands RUD -DEFAULT_NETWORKS=10 -DEFAULT_PORTS=50 -tenant_id=tenant_a -tenant_id_b=tenant_b -neutron quota-update $FORMAT --tenant_id $tenant_id --network 30 || die "fail to update quota for tenant $tenant_id" -neutron quota-update $FORMAT --tenant_id $tenant_id_b --network 20 || die "fail to update quota for tenant $tenant_id" -networks=`neutron quota-list $FORMAT -c network -c tenant_id | grep $tenant_id | awk '{print $2}'` -if [ $networks -ne 30 ]; then - die "networks quota should be 30" -fi -networks=`neutron quota-list $FORMAT -c network -c tenant_id | grep $tenant_id_b | awk '{print $2}'` -if [ $networks -ne 20 ]; then - die "networks quota should be 20" -fi -networks=`neutron quota-show $FORMAT --tenant_id $tenant_id | grep network | awk -F'|' '{print $3}'` -if [ $networks -ne 30 ]; then - die "networks quota should be 30" -fi -neutron quota-delete $FORMAT --tenant_id $tenant_id || die "fail to delete quota for tenant $tenant_id" -networks=`neutron quota-show $FORMAT --tenant_id $tenant_id | grep network | awk -F'|' '{print $3}'` -if [ $networks -ne $DEFAULT_NETWORKS ]; then - die "networks quota should be $DEFAULT_NETWORKS" -fi -# update self -if [ "t$NOAUTH" = "t" ]; then - # with auth - neutron quota-update $FORMAT --port 99 || die "fail to update quota for self" - ports=`neutron quota-show $FORMAT | grep port | awk -F'|' '{print $3}'` - if [ $ports -ne 99 ]; then - die "ports quota should be 99" - fi - - ports=`neutron quota-list $FORMAT -c port | grep 99 | awk '{print $2}'` - if [ $ports -ne 99 ]; then - die "ports quota should be 99" - fi - neutron quota-delete $FORMAT || die "fail to delete quota for tenant self" - ports=`neutron quota-show $FORMAT | grep port | awk -F'|' '{print $3}'` - if [ $ports -ne $DEFAULT_PORTS ]; then - die "ports quota should be $DEFAULT_PORTS" - fi -else - # without auth - neutron quota-update $FORMAT --port 100 - if [ $? -eq 0 ]; then - die "without valid context on server, quota update command should fail." - fi - neutron quota-show $FORMAT - if [ $? -eq 0 ]; then - die "without valid context on server, quota show command should fail." - fi - neutron quota-delete $FORMAT - if [ $? -eq 0 ]; then - die "without valid context on server, quota delete command should fail." - fi - neutron quota-list $FORMAT || die "fail to update quota for self" -fi diff --git a/openstack-common.conf b/openstack-common.conf index 902a82e4..cb17be8d 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -4,4 +4,4 @@ modules=gettextutils,jsonutils,strutils,timeutils # The base module to hold the copy of openstack.common -base=neutronclient +base=tackerclient diff --git a/setup.cfg b/setup.cfg index 50dba19d..50711615 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = python-neutronclient +name = python-tackerclient summary = CLI and Client Library for OpenStack Networking description-file = README.rst @@ -20,7 +20,7 @@ classifier = [files] packages = - neutronclient + tackerclient [global] setup-hooks = @@ -28,7 +28,7 @@ setup-hooks = [entry_points] console_scripts = - neutron = neutronclient.shell:main + tacker = tackerclient.shell:main [build_sphinx] all_files = 1 diff --git a/tacker_test.sh b/tacker_test.sh new file mode 100755 index 00000000..42609833 --- /dev/null +++ b/tacker_test.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -x +function die() { + local exitcode=$? + set +o xtrace + echo $@ + exit $exitcode +} + +noauth_tenant_id=me +if [ $1 == 'noauth' ]; then + NOAUTH="--tenant_id $noauth_tenant_id" +else + NOAUTH= +fi + +FORMAT=" --request-format xml" + +# test the CRUD of xxx +# TODO(yamahata) diff --git a/tools/neutron.bash_completion b/tools/neutron.bash_completion deleted file mode 100644 index 3e542e0a..00000000 --- a/tools/neutron.bash_completion +++ /dev/null @@ -1,27 +0,0 @@ -_neutron_opts="" # lazy init -_neutron_flags="" # lazy init -_neutron_opts_exp="" # lazy init -_neutron() -{ - local cur prev nbc cflags - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - - if [ "x$_neutron_opts" == "x" ] ; then - nbc="`neutron bash-completion`" - _neutron_opts="`echo "$nbc" | sed -e "s/--[a-z0-9_-]*//g" -e "s/\s\s*/ /g"`" - _neutron_flags="`echo " $nbc" | sed -e "s/ [^-][^-][a-z0-9_-]*//g" -e "s/\s\s*/ /g"`" - _neutron_opts_exp="`echo "$_neutron_opts" | sed -e "s/\s/|/g"`" - fi - - if [[ " ${COMP_WORDS[@]} " =~ " "($_neutron_opts_exp)" " && "$prev" != "help" ]] ; then - COMPLETION_CACHE=~/.neutronclient/*/*-cache - cflags="$_neutron_flags "$(cat $COMPLETION_CACHE 2> /dev/null | tr '\n' ' ') - COMPREPLY=($(compgen -W "${cflags}" -- ${cur})) - else - COMPREPLY=($(compgen -W "${_neutron_opts}" -- ${cur})) - fi - return 0 -} -complete -F _neutron neutron diff --git a/tools/tacker.bash_completion b/tools/tacker.bash_completion new file mode 100644 index 00000000..87f0e39b --- /dev/null +++ b/tools/tacker.bash_completion @@ -0,0 +1,27 @@ +_tacker_opts="" # lazy init +_tacker_flags="" # lazy init +_tacker_opts_exp="" # lazy init +_tacker() +{ + local cur prev nbc cflags + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + if [ "x$_tacker_opts" == "x" ] ; then + nbc="`tacker bash-completion`" + _tacker_opts="`echo "$nbc" | sed -e "s/--[a-z0-9_-]*//g" -e "s/\s\s*/ /g"`" + _tacker_flags="`echo " $nbc" | sed -e "s/ [^-][^-][a-z0-9_-]*//g" -e "s/\s\s*/ /g"`" + _tacker_opts_exp="`echo "$_tacker_opts" | sed -e "s/\s/|/g"`" + fi + + if [[ " ${COMP_WORDS[@]} " =~ " "($_tacker_opts_exp)" " && "$prev" != "help" ]] ; then + COMPLETION_CACHE=~/.tackerclient/*/*-cache + cflags="$_tacker_flags "$(cat $COMPLETION_CACHE 2> /dev/null | tr '\n' ' ') + COMPREPLY=($(compgen -W "${cflags}" -- ${cur})) + else + COMPREPLY=($(compgen -W "${_tacker_opts}" -- ${cur})) + fi + return 0 +} +complete -F _tacker tacker