Skip to content

Commit 93ac15b

Browse files
committed
Rename quantumclient to neutronclient
Implements Blueprint: remove-use-of-quantum Change-Id: Idebe92d56d277435ffd23f292984f9b8b8fdb2df
1 parent 8ed3870 commit 93ac15b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+658
-737
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ build-stamp
88
cover/*
99
doc/build/
1010
doc/source/api/
11-
python_quantumclient.egg-info/*
12-
quantum/vcsversion.py
13-
quantumclient/versioninfo
11+
python_neutronclient.egg-info/*
12+
neutron/vcsversion.py
13+
neutronclient/versioninfo
1414
run_tests.err.log
1515
run_tests.log
1616
.autogenerated

HACKING.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
QuantumClient Style Commandments
1+
Neutron Style Commandments
22
================================
33

44
- Step 1: Read http://www.python.org/dev/peps/pep-0008/
@@ -39,7 +39,7 @@ Example::
3939
\n
4040
{{third-party lib imports in human alphabetical order}}
4141
\n
42-
{{quantum imports in human alphabetical order}}
42+
{{neutron imports in human alphabetical order}}
4343
\n
4444
\n
4545
{{begin your code}}
@@ -59,12 +59,12 @@ Example::
5959
import eventlet
6060
import webob.exc
6161

62-
import quantum.api.networks
63-
from quantum.api import ports
64-
from quantum.db import models
65-
from quantum.extensions import multiport
66-
import quantum.manager
67-
from quantum import service
62+
import neutron.api.networks
63+
from neutron.api import ports
64+
from neutron.db import models
65+
from neutron.extensions import multiport
66+
import neutron.manager
67+
from neutron import service
6868

6969

7070
Docstrings

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This is the client API library for Quantum.
1+
This is the client API library for Neutron.

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
import os
66

7-
project = 'python-quantumclient'
7+
project = 'python-neutronclient'
88

99
# -- General configuration ---------------------------------------------
1010

doc/source/index.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
Python bindings to the OpenStack Network API
22
============================================
33

4-
In order to use the python quantum client directly, you must first obtain an auth token and identify which endpoint you wish to speak to. Once you have done so, you can use the API like so::
4+
In order to use the python neutron client directly, you must first obtain an auth token and identify which endpoint you wish to speak to. Once you have done so, you can use the API like so::
55

66
>>> import logging
7-
>>> from quantumclient.quantum import client
7+
>>> from neutronclient.neutron import client
88
>>> logging.basicConfig(level=logging.DEBUG)
9-
>>> quantum = client.Client('2.0', endpoint_url=OS_URL, token=OS_TOKEN)
10-
>>> quantum.format = 'json'
9+
>>> neutron = client.Client('2.0', endpoint_url=OS_URL, token=OS_TOKEN)
10+
>>> neutron.format = 'json'
1111
>>> network = {'name': 'mynetwork', 'admin_state_up': True}
12-
>>> quantum.create_network({'network':network})
13-
>>> networks = quantum.list_networks(name='mynetwork')
12+
>>> neutron.create_network({'network':network})
13+
>>> networks = neutron.list_networks(name='mynetwork')
1414
>>> print networks
1515
>>> network_id = networks['networks'][0]['id']
16-
>>> quantum.delete_network(network_id)
16+
>>> neutron.delete_network(network_id)
1717

1818

1919
Command-line Tool
@@ -27,21 +27,21 @@ In order to use the CLI, you must provide your OpenStack username, password, ten
2727

2828
The command line tool will attempt to reauthenticate using your provided credentials for every request. You can override this behavior by manually supplying an auth token using ``--os-url`` and ``--os-auth-token``. You can alternatively set these environment variables::
2929

30-
export OS_URL=http://quantum.example.org:9696/
30+
export OS_URL=http://neutron.example.org:9696/
3131
export OS_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155
3232

33-
If quantum server does not require authentication, besides these two arguments or environment variables (We can use any value as token.), we need manually supply ``--os-auth-strategy`` or set the environment variable::
33+
If neutron server does not require authentication, besides these two arguments or environment variables (We can use any value as token.), we need manually supply ``--os-auth-strategy`` or set the environment variable::
3434

3535
export OS_AUTH_STRATEGY=noauth
3636

37-
Once you've configured your authentication parameters, you can run ``quantum -h`` to see a complete listing of available commands.
37+
Once you've configured your authentication parameters, you can run ``neutron -h`` to see a complete listing of available commands.
3838

3939
Release Notes
4040
=============
4141

4242
2.0
4343
-----
44-
* support Quantum API 2.0
44+
* support Neutron API 2.0
4545

4646
2.2.0
4747
-----

quantum_test.sh renamed to neutron_test.sh

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,111 +18,111 @@ FORMAT=" --request-format xml"
1818

1919
# test the CRUD of network
2020
network=mynet1
21-
quantum net-create $FORMAT $NOAUTH $network || die "fail to create network $network"
22-
temp=`quantum net-list $FORMAT -- --name $network --fields id | wc -l`
21+
neutron net-create $FORMAT $NOAUTH $network || die "fail to create network $network"
22+
temp=`neutron net-list $FORMAT -- --name $network --fields id | wc -l`
2323
echo $temp
2424
if [ $temp -ne 5 ]; then
2525
die "networks with name $network is not unique or found"
2626
fi
27-
network_id=`quantum net-list -- --name $network --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
27+
network_id=`neutron net-list -- --name $network --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
2828
echo "ID of network with name $network is $network_id"
2929

30-
quantum net-show $FORMAT $network || die "fail to show network $network"
31-
quantum net-show $FORMAT $network_id || die "fail to show network $network_id"
30+
neutron net-show $FORMAT $network || die "fail to show network $network"
31+
neutron net-show $FORMAT $network_id || die "fail to show network $network_id"
3232

33-
quantum net-update $FORMAT $network --admin_state_up False || die "fail to update network $network"
34-
quantum net-update $FORMAT $network_id --admin_state_up True || die "fail to update network $network_id"
33+
neutron net-update $FORMAT $network --admin_state_up False || die "fail to update network $network"
34+
neutron net-update $FORMAT $network_id --admin_state_up True || die "fail to update network $network_id"
3535

36-
quantum net-list $FORMAT -c id -- --id fakeid || die "fail to list networks with column selection on empty list"
36+
neutron net-list $FORMAT -c id -- --id fakeid || die "fail to list networks with column selection on empty list"
3737

3838
# test the CRUD of subnet
3939
subnet=mysubnet1
4040
cidr=10.0.1.3/24
41-
quantum subnet-create $FORMAT $NOAUTH $network $cidr --name $subnet || die "fail to create subnet $subnet"
42-
tempsubnet=`quantum subnet-list $FORMAT -- --name $subnet --fields id | wc -l`
41+
neutron subnet-create $FORMAT $NOAUTH $network $cidr --name $subnet || die "fail to create subnet $subnet"
42+
tempsubnet=`neutron subnet-list $FORMAT -- --name $subnet --fields id | wc -l`
4343
echo $tempsubnet
4444
if [ $tempsubnet -ne 5 ]; then
4545
die "subnets with name $subnet is not unique or found"
4646
fi
47-
subnet_id=`quantum subnet-list $FORMAT -- --name $subnet --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
47+
subnet_id=`neutron subnet-list $FORMAT -- --name $subnet --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
4848
echo "ID of subnet with name $subnet is $subnet_id"
49-
quantum subnet-show $FORMAT $subnet || die "fail to show subnet $subnet"
50-
quantum subnet-show $FORMAT $subnet_id || die "fail to show subnet $subnet_id"
49+
neutron subnet-show $FORMAT $subnet || die "fail to show subnet $subnet"
50+
neutron subnet-show $FORMAT $subnet_id || die "fail to show subnet $subnet_id"
5151

52-
quantum subnet-update $FORMAT $subnet --dns_namesevers host1 || die "fail to update subnet $subnet"
53-
quantum subnet-update $FORMAT $subnet_id --dns_namesevers host2 || die "fail to update subnet $subnet_id"
52+
neutron subnet-update $FORMAT $subnet --dns_namesevers host1 || die "fail to update subnet $subnet"
53+
neutron subnet-update $FORMAT $subnet_id --dns_namesevers host2 || die "fail to update subnet $subnet_id"
5454

5555
# test the crud of ports
5656
port=myport1
57-
quantum port-create $FORMAT $NOAUTH $network --name $port || die "fail to create port $port"
58-
tempport=`quantum port-list $FORMAT -- --name $port --fields id | wc -l`
57+
neutron port-create $FORMAT $NOAUTH $network --name $port || die "fail to create port $port"
58+
tempport=`neutron port-list $FORMAT -- --name $port --fields id | wc -l`
5959
echo $tempport
6060
if [ $tempport -ne 5 ]; then
6161
die "ports with name $port is not unique or found"
6262
fi
63-
port_id=`quantum port-list $FORMAT -- --name $port --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
63+
port_id=`neutron port-list $FORMAT -- --name $port --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
6464
echo "ID of port with name $port is $port_id"
65-
quantum port-show $FORMAT $port || die "fail to show port $port"
66-
quantum port-show $FORMAT $port_id || die "fail to show port $port_id"
65+
neutron port-show $FORMAT $port || die "fail to show port $port"
66+
neutron port-show $FORMAT $port_id || die "fail to show port $port_id"
6767

68-
quantum port-update $FORMAT $port --device_id deviceid1 || die "fail to update port $port"
69-
quantum port-update $FORMAT $port_id --device_id deviceid2 || die "fail to update port $port_id"
68+
neutron port-update $FORMAT $port --device_id deviceid1 || die "fail to update port $port"
69+
neutron port-update $FORMAT $port_id --device_id deviceid2 || die "fail to update port $port_id"
7070

7171
# test quota commands RUD
7272
DEFAULT_NETWORKS=10
7373
DEFAULT_PORTS=50
7474
tenant_id=tenant_a
7575
tenant_id_b=tenant_b
76-
quantum quota-update $FORMAT --tenant_id $tenant_id --network 30 || die "fail to update quota for tenant $tenant_id"
77-
quantum quota-update $FORMAT --tenant_id $tenant_id_b --network 20 || die "fail to update quota for tenant $tenant_id"
78-
networks=`quantum quota-list $FORMAT -c network -c tenant_id | grep $tenant_id | awk '{print $2}'`
76+
neutron quota-update $FORMAT --tenant_id $tenant_id --network 30 || die "fail to update quota for tenant $tenant_id"
77+
neutron quota-update $FORMAT --tenant_id $tenant_id_b --network 20 || die "fail to update quota for tenant $tenant_id"
78+
networks=`neutron quota-list $FORMAT -c network -c tenant_id | grep $tenant_id | awk '{print $2}'`
7979
if [ $networks -ne 30 ]; then
8080
die "networks quota should be 30"
8181
fi
82-
networks=`quantum quota-list $FORMAT -c network -c tenant_id | grep $tenant_id_b | awk '{print $2}'`
82+
networks=`neutron quota-list $FORMAT -c network -c tenant_id | grep $tenant_id_b | awk '{print $2}'`
8383
if [ $networks -ne 20 ]; then
8484
die "networks quota should be 20"
8585
fi
86-
networks=`quantum quota-show $FORMAT --tenant_id $tenant_id | grep network | awk -F'|' '{print $3}'`
86+
networks=`neutron quota-show $FORMAT --tenant_id $tenant_id | grep network | awk -F'|' '{print $3}'`
8787
if [ $networks -ne 30 ]; then
8888
die "networks quota should be 30"
8989
fi
90-
quantum quota-delete $FORMAT --tenant_id $tenant_id || die "fail to delete quota for tenant $tenant_id"
91-
networks=`quantum quota-show $FORMAT --tenant_id $tenant_id | grep network | awk -F'|' '{print $3}'`
90+
neutron quota-delete $FORMAT --tenant_id $tenant_id || die "fail to delete quota for tenant $tenant_id"
91+
networks=`neutron quota-show $FORMAT --tenant_id $tenant_id | grep network | awk -F'|' '{print $3}'`
9292
if [ $networks -ne $DEFAULT_NETWORKS ]; then
9393
die "networks quota should be $DEFAULT_NETWORKS"
9494
fi
9595
# update self
9696
if [ "t$NOAUTH" = "t" ]; then
9797
# with auth
98-
quantum quota-update $FORMAT --port 99 || die "fail to update quota for self"
99-
ports=`quantum quota-show $FORMAT | grep port | awk -F'|' '{print $3}'`
98+
neutron quota-update $FORMAT --port 99 || die "fail to update quota for self"
99+
ports=`neutron quota-show $FORMAT | grep port | awk -F'|' '{print $3}'`
100100
if [ $ports -ne 99 ]; then
101101
die "ports quota should be 99"
102102
fi
103-
104-
ports=`quantum quota-list $FORMAT -c port | grep 99 | awk '{print $2}'`
103+
104+
ports=`neutron quota-list $FORMAT -c port | grep 99 | awk '{print $2}'`
105105
if [ $ports -ne 99 ]; then
106106
die "ports quota should be 99"
107107
fi
108-
quantum quota-delete $FORMAT || die "fail to delete quota for tenant self"
109-
ports=`quantum quota-show $FORMAT | grep port | awk -F'|' '{print $3}'`
108+
neutron quota-delete $FORMAT || die "fail to delete quota for tenant self"
109+
ports=`neutron quota-show $FORMAT | grep port | awk -F'|' '{print $3}'`
110110
if [ $ports -ne $DEFAULT_PORTS ]; then
111111
die "ports quota should be $DEFAULT_PORTS"
112112
fi
113113
else
114114
# without auth
115-
quantum quota-update $FORMAT --port 100
115+
neutron quota-update $FORMAT --port 100
116116
if [ $? -eq 0 ]; then
117117
die "without valid context on server, quota update command should fail."
118118
fi
119-
quantum quota-show $FORMAT
119+
neutron quota-show $FORMAT
120120
if [ $? -eq 0 ]; then
121121
die "without valid context on server, quota show command should fail."
122122
fi
123-
quantum quota-delete $FORMAT
123+
neutron quota-delete $FORMAT
124124
if [ $? -eq 0 ]; then
125125
die "without valid context on server, quota delete command should fail."
126126
fi
127-
quantum quota-list $FORMAT || die "fail to update quota for self"
127+
neutron quota-list $FORMAT || die "fail to update quota for self"
128128
fi
File renamed without changes.

quantumclient/client.py renamed to neutronclient/client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@
2929

3030
import httplib2
3131

32-
from quantumclient.common import exceptions
33-
from quantumclient.common import utils
32+
from neutronclient.common import exceptions
33+
from neutronclient.common import utils
3434

3535
_logger = logging.getLogger(__name__)
3636

37-
if 'QUANTUMCLIENT_DEBUG' in os.environ and os.environ['QUANTUMCLIENT_DEBUG']:
37+
38+
if os.environ.get('NEUTRONCLIENT_DEBUG'):
3839
ch = logging.StreamHandler()
3940
_logger.setLevel(logging.DEBUG)
4041
_logger.addHandler(ch)
@@ -61,7 +62,7 @@ def get_token(self):
6162

6263
def url_for(self, attr=None, filter_value=None,
6364
service_type='network', endpoint_type='publicURL'):
64-
"""Fetch the URL from the Quantum service for
65+
"""Fetch the URL from the Neutron service for
6566
a particular endpoint type. If none given, return
6667
publicURL.
6768
"""
@@ -91,7 +92,7 @@ def url_for(self, attr=None, filter_value=None,
9192
class HTTPClient(httplib2.Http):
9293
"""Handles the REST calls and responses, include authn."""
9394

94-
USER_AGENT = 'python-quantumclient'
95+
USER_AGENT = 'python-neutronclient'
9596

9697
def __init__(self, username=None, tenant_name=None,
9798
password=None, auth_url=None,
@@ -215,7 +216,7 @@ def _get_endpoint_url(self):
215216
try:
216217
resp, body = self._cs_request(url, "GET")
217218
except exceptions.Unauthorized:
218-
# rollback to authenticate() to handle case when quantum client
219+
# rollback to authenticate() to handle case when neutron client
219220
# is initialized just before the token is expired
220221
self.authenticate()
221222
return self.endpoint_url

quantumclient/common/__init__.py renamed to neutronclient/common/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import gettext
1919

20-
t = gettext.translation('quantumclient', fallback=True)
20+
t = gettext.translation('neutronclient', fallback=True)
2121

2222

2323
def _(msg):

quantumclient/common/clientmanager.py renamed to neutronclient/common/clientmanager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
import logging
2222

23-
from quantumclient import client
24-
from quantumclient.quantum import client as quantum_client
23+
from neutronclient import client
24+
from neutronclient.neutron import client as neutron_client
2525

2626

2727
LOG = logging.getLogger(__name__)
@@ -45,7 +45,7 @@ def __get__(self, instance, owner):
4545
class ClientManager(object):
4646
"""Manages access to API clients, including authentication.
4747
"""
48-
quantum = ClientCache(quantum_client.make_client)
48+
neutron = ClientCache(neutron_client.make_client)
4949

5050
def __init__(self, token=None, url=None,
5151
auth_url=None,
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)