Skip to content

Commit ee3fe4e

Browse files
committed
Rename Quantum to Neutron
This change renames everything to Neutron while providing backwards compatible adjustments for Grizzly configuration files. implements blueprint: remove-use-of-quantum Change-Id: Ie7d07ba7c89857e13d4ddc8f0e9b68de020a3d19
1 parent fc52854 commit ee3fe4e

File tree

714 files changed

+4924
-4445
lines changed

Some content is hidden

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

714 files changed

+4924
-4445
lines changed

.bzrignore

+5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ quantum.egg-info
33
quantum_tests.sqlite
44
quantum.sqlite
55
*.quantum-venv
6+
neutron.egg-info
7+
neutron_tests.sqlite
8+
neutron.sqlite
9+
*.neutron-venv
610
.venv
711
dist/
812
ChangeLog
913
*.pid
1014
*.log
15+
neutron/vcsversion.py
1116
quantum/vcsversion.py
1217
.ropeproject

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ dist/
88
doc/build
99
*.DS_Store
1010
*.pyc
11+
neutron.egg-info/
12+
neutron/vcsversion.py
13+
neutron/versioninfo
1114
quantum.egg-info/
1215
quantum/vcsversion.py
1316
quantum/versioninfo

.pylintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ argument-rgx=[a-z_][a-z0-9_]{1,30}$
2323
# and be lowecased with underscores
2424
method-rgx=([a-z_][a-z0-9_]{2,50}|setUp|tearDown)$
2525

26-
# Module names matching quantum-* are ok (files in bin/)
26+
# Module names matching neutron-* are ok (files in bin/)
27+
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(neutron-[a-z0-9_-]+))$
2728
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(quantum-[a-z0-9_-]+))$
2829

2930
# Don't require docstrings on tests.

.testr.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[DEFAULT]
2-
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ quantum/tests/unit $LISTOPT $IDOPTION
2+
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ neutron/tests/unit $LISTOPT $IDOPTION
33
test_id_option=--load-list $IDFILE
44
test_list_option=--list

HACKING.rst

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Quantum Style Commandments
1+
Neutron Style Commandments
22
==========================
33

44
- Step 1: Read http://www.python.org/dev/peps/pep-0008/
@@ -35,13 +35,13 @@ Example::
3535

3636
The following imports,
3737

38-
from quantum.api import networks
39-
from quantum import wsgi
38+
from neutron.api import networks
39+
from neutron import wsgi
4040

4141
are considered equivalent for ordering purposes to
4242

43-
import quantum.api.networks
44-
import quantum.wsgi
43+
import neutron.api.networks
44+
import neutron.wsgi
4545

4646
- Organize your imports according to the following template
4747

@@ -52,7 +52,7 @@ Example::
5252
\n
5353
{{third-party lib imports in human alphabetical order}}
5454
\n
55-
{{quantum imports in human alphabetical order}}
55+
{{neutron imports in human alphabetical order}}
5656
\n
5757
\n
5858
{{begin your code}}
@@ -71,13 +71,13 @@ Example::
7171
import testtools
7272
import webob.exc
7373

74-
import quantum.api.networks
75-
from quantum.api import ports
76-
from quantum.db import models
77-
from quantum.extensions import multiport
78-
from quantum.openstack.common import log as logging
79-
import quantum.manager
80-
from quantum import service
74+
import neutron.api.networks
75+
from neutron.api import ports
76+
from neutron.db import models
77+
from neutron.extensions import multiport
78+
from neutron.openstack.common import log as logging
79+
import neutron.manager
80+
from neutron import service
8181

8282

8383
Docstrings
@@ -202,8 +202,8 @@ submitted bug fix does have a unit test, be sure to add a new one that fails
202202
without the patch and passes with the patch.
203203

204204
All unittest classes must ultimately inherit from testtools.TestCase. In the
205-
Quantum test suite, this should be done by inheriting from
206-
quantum.tests.base.BaseTestCase.
205+
Neutron test suite, this should be done by inheriting from
206+
neutron.tests.base.BaseTestCase.
207207

208208
All setUp and tearDown methods must upcall using the super() method.
209209
tearDown methods should be avoided and addCleanup calls should be preferred.

MANIFEST.in

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ include AUTHORS
22
include README.rst
33
include ChangeLog
44
include LICENSE
5-
include quantum/db/migration/README
6-
include quantum/db/migration/alembic.ini
7-
include quantum/db/migration/alembic_migrations/script.py.mako
8-
include quantum/db/migration/alembic_migrations/versions/README
9-
recursive-include quantum/locale *
5+
include neutron/db/migration/README
6+
include neutron/db/migration/alembic.ini
7+
include neutron/db/migration/alembic_migrations/script.py.mako
8+
include neutron/db/migration/alembic_migrations/versions/README
9+
recursive-include neutron/locale *
1010

1111
exclude .gitignore
1212
exclude .gitreview

README.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# -- Welcome!
22

33
You have come across a cloud computing network fabric controller. It has
4-
identified itself as "Quantum." It aims to tame your (cloud) networking!
4+
identified itself as "Neutron." It aims to tame your (cloud) networking!
55

66
# -- External Resources:
77

8-
The homepage for Quantum is: http://launchpad.net/quantum . Use this
8+
The homepage for Neutron is: http://launchpad.net/neutron . Use this
99
site for asking for help, and filing bugs. Code is available on github at
10-
<http://github.com/openstack/quantum>.
10+
<http://github.com/openstack/neutron>.
1111

12-
The latest and most in-depth documentation on how to use Quantum is
12+
The latest and most in-depth documentation on how to use Neutron is
1313
available at: <http://docs.openstack.org>. This includes:
1414

15-
Quantum Administrator Guide
15+
Neutron Administrator Guide
1616
http://docs.openstack.org/trunk/openstack-network/admin/content/
1717

18-
Quantum API Reference:
18+
Neutron API Reference:
1919
http://docs.openstack.org/api/openstack-network/2.0/content/
2020

2121
The start of some developer documentation is available at:
22-
http://wiki.openstack.org/QuantumDevelopment
22+
http://wiki.openstack.org/NeutronDevelopment
2323

24-
For help using or hacking on Quantum, you can send mail to
24+
For help using or hacking on Neutron, you can send mail to
2525

TESTING

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
Testing Quantum
1+
Testing Neutron
22
=============================================================
33

44
Overview
55

66
The unit tests are meant to cover as much code as possible and should
77
be executed without the service running. They are designed to test
8-
the various pieces of the quantum tree to make sure any new changes
8+
the various pieces of the neutron tree to make sure any new changes
99
don't break existing functionality.
1010

1111
Running tests
@@ -30,17 +30,17 @@ Running individual tests
3030
class separating it from the module path with a colon.
3131

3232
For example, the following would run only the JSONV2TestCase tests from
33-
quantum/tests/unit/test_api_v2.py:
33+
neutron/tests/unit/test_api_v2.py:
3434

35-
$ ./run_tests.sh quantum.tests.unit.test_api_v2:JSONV2TestCase
35+
$ ./run_tests.sh neutron.tests.unit.test_api_v2:JSONV2TestCase
3636

3737
or
3838

39-
$ ./tox quantum.tests.unit.test_api_v2:JSONV2TestCase
39+
$ ./tox neutron.tests.unit.test_api_v2:JSONV2TestCase
4040

4141
Adding more tests
4242

43-
Quantum has a fast growing code base and there is plenty of areas that
43+
Neutron has a fast growing code base and there is plenty of areas that
4444
need to be covered by unit tests.
4545

4646
To get a grasp of the areas where unit tests are needed, you can check
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python
2+
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3+
4+
# Copyright (c) 2012 OpenStack Foundation.
5+
# All Rights Reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
# not use this file except in compliance with the License. You may obtain
9+
# a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
19+
from neutron.agent.linux import dhcp
20+
dhcp.Dnsmasq.lease_update()

bin/neutron-rootwrap

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
#!/usr/bin/env python
2+
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3+
4+
# Copyright (c) 2012 OpenStack Foundation.
5+
# All Rights Reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
# not use this file except in compliance with the License. You may obtain
9+
# a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
19+
"""Root wrapper for Neutron
20+
21+
Filters which commands neutron is allowed to run as another user.
22+
23+
To use this, you should set the following in neutron.conf and the
24+
various .ini files for the agent plugins:
25+
root_helper=sudo neutron-rootwrap /etc/neutron/rootwrap.conf
26+
27+
You also need to let the neutron user run neutron-rootwrap as root in
28+
/etc/sudoers:
29+
neutron ALL = (root) NOPASSWD: /usr/bin/neutron-rootwrap
30+
/etc/neutron/rootwrap.conf *
31+
32+
Filter specs live in /etc/neutron/rootwrap.d/*.filters, or
33+
other locations pointed to by /etc/neutron/rootwrap.conf.
34+
To make allowed commands node-specific, your packaging should only
35+
install apropriate .filters for commands which are needed on each
36+
node.
37+
"""
38+
39+
from __future__ import print_function
40+
41+
import ConfigParser
42+
import logging
43+
import os
44+
import pwd
45+
import signal
46+
import subprocess
47+
import sys
48+
49+
50+
RC_UNAUTHORIZED = 99
51+
RC_NOCOMMAND = 98
52+
RC_BADCONFIG = 97
53+
RC_NOEXECFOUND = 96
54+
55+
56+
def _subprocess_setup():
57+
# Python installs a SIGPIPE handler by default. This is usually not what
58+
# non-Python subprocesses expect.
59+
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
60+
61+
62+
def _exit_error(execname, message, errorcode, log=True):
63+
print("%s: %s" % (execname, message))
64+
if log:
65+
logging.error(message)
66+
sys.exit(errorcode)
67+
68+
69+
if __name__ == '__main__':
70+
# Split arguments, require at least a command
71+
execname = sys.argv.pop(0)
72+
if len(sys.argv) < 2:
73+
_exit_error(execname, "No command specified", RC_NOCOMMAND, log=False)
74+
75+
configfile = sys.argv.pop(0)
76+
userargs = sys.argv[:]
77+
78+
# Add ../ to sys.path to allow running from branch
79+
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(execname),
80+
os.pardir, os.pardir))
81+
if os.path.exists(os.path.join(possible_topdir, "neutron", "__init__.py")):
82+
sys.path.insert(0, possible_topdir)
83+
84+
from neutron.rootwrap import wrapper
85+
86+
# Load configuration
87+
try:
88+
rawconfig = ConfigParser.RawConfigParser()
89+
rawconfig.read(configfile)
90+
config = wrapper.RootwrapConfig(rawconfig)
91+
except ValueError as exc:
92+
msg = "Incorrect value in %s: %s" % (configfile, exc.message)
93+
_exit_error(execname, msg, RC_BADCONFIG, log=False)
94+
except ConfigParser.Error:
95+
_exit_error(execname, "Incorrect configuration file: %s" % configfile,
96+
RC_BADCONFIG, log=False)
97+
98+
if config.use_syslog:
99+
wrapper.setup_syslog(execname,
100+
config.syslog_log_facility,
101+
config.syslog_log_level)
102+
103+
# Execute command if it matches any of the loaded filters
104+
filters = wrapper.load_filters(config.filters_path)
105+
try:
106+
filtermatch = wrapper.match_filter(filters, userargs,
107+
exec_dirs=config.exec_dirs)
108+
if filtermatch:
109+
command = filtermatch.get_command(userargs,
110+
exec_dirs=config.exec_dirs)
111+
if config.use_syslog:
112+
logging.info("(%s > %s) Executing %s (filter match = %s)" % (
113+
os.getlogin(), pwd.getpwuid(os.getuid())[0],
114+
command, filtermatch.name))
115+
116+
obj = subprocess.Popen(command,
117+
stdin=sys.stdin,
118+
stdout=sys.stdout,
119+
stderr=sys.stderr,
120+
preexec_fn=_subprocess_setup,
121+
env=filtermatch.get_environment(userargs))
122+
obj.wait()
123+
sys.exit(obj.returncode)
124+
125+
except wrapper.FilterMatchNotExecutable as exc:
126+
msg = ("Executable not found: %s (filter match = %s)"
127+
% (exc.match.exec_path, exc.match.name))
128+
_exit_error(execname, msg, RC_NOEXECFOUND, log=config.use_syslog)
129+
130+
except wrapper.NoFilterMatched:
131+
msg = ("Unauthorized command: %s (no filter matched)"
132+
% ' '.join(userargs))
133+
_exit_error(execname, msg, RC_UNAUTHORIZED, log=config.use_syslog)

bin/quantum-check-nvp-config

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import os
2323
import sys
2424
sys.path.insert(0, os.getcwd())
2525

26-
from quantum.plugins.nicira.check_nvp_config import main
26+
from neutron.plugins.nicira.check_nvp_config import main
2727

2828

2929
main(sys.argv)

bin/quantum-db-manage

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import os
2020
import sys
2121
sys.path.insert(0, os.getcwd())
2222

23-
from quantum.db.migration.cli import main
23+
from neutron.db.migration.cli import main
2424

2525

2626
main()

bin/quantum-debug

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
# License for the specific language governing permissions and limitations
1717
# under the License.
1818

19-
from quantum.debug.shell import main
19+
from neutron.debug.shell import main
2020
main()

bin/quantum-dhcp-agent

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
# License for the specific language governing permissions and limitations
1717
# under the License.
1818

19-
from quantum.agent.dhcp_agent import main
19+
from neutron.agent.dhcp_agent import main
2020
main()

bin/quantum-dhcp-agent-dnsmasq-lease-update

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
# License for the specific language governing permissions and limitations
1717
# under the License.
1818

19-
from quantum.agent.linux import dhcp
19+
from neutron.agent.linux import dhcp
2020
dhcp.Dnsmasq.lease_update()

bin/quantum-hyperv-agent

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import os
2020
import sys
2121
sys.path.insert(0, os.getcwd())
2222

23-
from quantum.plugins.hyperv.agent.hyperv_quantum_agent import main
23+
from neutron.plugins.hyperv.agent.hyperv_neutron_agent import main
2424

2525

2626
main()

0 commit comments

Comments
 (0)