Commit Graph

36 Commits

Author SHA1 Message Date
Stephen Finucane f5f73b4c4e nova-net: Kill it
Finish the job by removing all the now-unused modules. This also allows
us to - wait for it - kill mox at long last. It's a great day in the
parish.

Partial-Implements: blueprint remove-nova-network-ussuri
Partial-Implements: blueprint mox-removal-ussuri

Change-Id: Ia33ec2604b2fc2d3b6830b596cac669cc3ad6c96
2020-01-14 21:25:56 +00:00
Jens Rosenboom 4647f418af Fix test_ipv6 and simplify to_global()
The tests test_to_global_with_bad_prefix and
test_to_global_with_bad_project are broken, they assert the TypeError
because they call to_global with an IPv6 address as MAC parameter and
do not check the functionality that they claim to check.

test_to_global_with_bad_project gets removed, because there is no
checking on the project_id, we simply hash whatever is there.

We also make sure that the correct error message is generated and add
a check to prevent regressing again.

While at it, simplify the code for to_global() in nova/ipv6/rfc2462.py.

Change-Id: I2a6f75beca1c37d135dcbb3a6eb0d739f2dd41e2
2016-06-28 20:42:32 +02:00
Victor Stinner 3204a46232 Port test_ipv6 to py3 and simplify to_global()
* ipv6.account_identifier.to_global(): on Python 3, encode project_id
  to UTF-8.
* Simplify also to_global(): replace netaddr.EUI(mac).words with
  netaddr.EUI.value to avoid conversions (int => str (hex) => int).
* tests-py3.txt: run nova.tests.unit.test_ipv6 on Python 3

Partially-Implements: blueprint nova-python3-newton
Change-Id: I6f6f711fd00980de8cdccbdfe2d636f21440aea7
2016-06-27 14:37:47 +02:00
Pushkar Umaranikar 8407f33ef1 Config options: Centralize ipv6 options
The config options of the section
"nova/ipv6" got moved to the new central
location "nova/conf/ipv6.py".

Change-Id: Ia53dd8f72755a645eb535e1866b8b662d159debd
Implements: blueprint centralize-config-options-newton
2016-04-05 17:09:53 +00:00
Eugeniya Kudryashova 77ca9fdd83 Replace usage of LazyPluggable by stevedore driver
Stevedore lib support lazy loading, so this change replace
LazyPluggable class by stevedore extentions and remove it

Stevedore support usage of driver property since 0.4 release,
some of Openstack projects like glance is already using it.

Change-Id: I7d384a73861e18cac04e07f75abd60df7f183aa2
2015-02-17 14:49:48 +00:00
Davanum Srinivas af2d6c9576 Switch to using oslo_* instead of oslo.*
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.

This commit includes:
- using oslo_utils instead of oslo.utils
- using oslo_serialization instead of oslo.serialization
- using oslo_db instead of oslo.db
- using oslo_i18n instead of oslo.i18n
- using oslo_middleware instead of oslo.middleware
- using oslo_config instead of oslo.config
- using oslo_messaging instead of "from oslo import messaging"
- using oslo_vmware instead of oslo.vmware

Change-Id: I3e2eb147b321ce3e928817b62abcb7d023c5f13f
2015-02-06 06:03:10 -05:00
Davanum Srinivas 826aed0ec7 Use oslo.i18n
oslo.i18n provides the i18n functions that were provided by
oslo-incubator's gettextutils module. Some tests that were
using internal details of the library were removed.

Change-Id: I44cfd5552e0dd86af21073419d31622f5fdb28e0
2014-07-18 14:28:09 -04:00
liu-sheng 74f953a1d7 Remove vi modelines
We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.

Also a check is added to hacking to detect if they are re-added.

Change-Id: I347307a5145b2760c69085b6ca850d6a9137ffc6
Closes-Bug: #1229324
2014-02-03 14:19:44 +00:00
Gary Kotton e33e1f3e81 Ensure that the netaddr import is in the 3rd party section
There were cases when the netaddr import was not in the correct place.

Change-Id: I7715fcfa8cade6a78a2a58dffdc9cdca13b7d59c
Closes-Bug: #1236744
2013-10-08 02:07:56 -07:00
Joe Gordon 8ff53b4267 Fix and Gate on H303 (no wildcard imports)
Wildcard imports make reading code unnecessarily confusing because they
make it harder to see where a functions comes from.  We had two types of
wildcard imports in the code. Unneeded ones in test files that are just
removed, and some that we actually want which are kept using the '#
noqa' comment to tell flake8 to skip specific checks (such as H303)
for that line.

Change-Id: Id4705011579659fd74a4aaa05ac541e9694c483e
2013-07-30 14:34:31 -07:00
Alex Gaynor cd9d8e45c6 Remove the monkey patching of _ into the builtins
Previous _ was monkey patched into builtins whenever
certain modules were imported. This removes that and
simply imports it when it is needed.

Change-Id: I0af2c6d8a230e94440d655d13cab9107ac20d13c
2013-07-26 07:31:17 -07:00
Kurt Taylor d17f9ab13d Update OpenStack LLC to Foundation
Update all references of "LLC" to "Foundation".

Change-Id: I009e86784ef4dcf38882d64b0eff484576e04efe
2013-02-26 19:15:29 -05:00
Mark McLoughlin 706a137005 Use oslo-config-2013.1b4
The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.

Add the 2013.1b4 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.

Add dependency_links to setup.py so that oslo-config can be installed
from the tarball URL specified in pip-requires.

Remove the 'deps = pep8==1.3.3' from tox.ini as it means all the other
deps get installed with easy_install which can't install oslo-config
from the URL.

Make tools/hacking.py include oslo in IMPORT_EXCEPTIONS like it already
does for paste. It turns out imp.find_module() doesn't correct handle
namespace packages.

Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
2013-02-19 21:16:32 -08:00
Sean Dague 2962882222 fix N402 for rest of nova
fix N402 (single line docstrings should end in a period) for
rest of nova files

Change-Id: I57d0d9ab01345dd83e544e476d79d2c2ca68ee51
2013-01-09 15:47:22 -05:00
Mark McLoughlin 94d87bce21 Remove nova.config.CONF
Modules import nova.config for two reasons right now - firstly, to
reference nova.config.CONF and, secondly, if they use one of the
options defined in nova.config.

Often modules import nova.openstack.common.cfg and nova.config
which is a bit pointless since they could just use cfg.CONF if
they just want to nova.config in order to reference CONF.

Let's just use cfg.CONF everywhere and we can explicitly state
where we actually require options defined in nova.config.

Change-Id: Ie4184a74e3e78c99658becb18dce1c2087e450bb
2012-11-20 00:00:21 +00:00
Mark McLoughlin 6e92a67fc3 Remove nova.flags
Now that options have all moved from nova.flags to nova.config, we can
safely remove the nova.flags imports and replace them with nova.config
imports.

Change-Id: Ic077a72dd6419bbf1e1babe71acfa43c4e8b55c8
2012-11-17 16:30:03 +00:00
Mark McLoughlin 637e805634 Switch from FLAGS to CONF in misc modules
Use the global CONF variable instead of FLAGS. This is purely a cleanup
since FLAGS is already just another reference to CONF.

We leave the nova.flags imports until a later cleanup commit since
removing them may cause unpredictable problems due to config options not
being registered.

Change-Id: Ib110ba8d1837780e90b0d3fe13f8e6b68ed15f65
2012-11-04 21:46:35 +00:00
Justin Hammond 4becac7cc1 Defined IMPL in global ipv6 namespace.
* fix LP1014798

Change-Id: Ife2cc064128ee99a7ba1352f10c373812c69dd13
2012-08-15 09:30:34 -07:00
Joe Gordon a58a50e060 Fix OpenStack Capitalization
Openstack => OpenStack
for nova/*py

Change-Id: Ibcfae4776422a515a109e59510fc84f8b63c00b9
2012-03-15 16:10:53 -07:00
Mark McLoughlin d1888a3359 Remove the last of the gflags shim layer
Make FLAGS a ConfigOpts instance and fix up all the places where we
expected FlagValues behaviour.

Change-Id: I8f96f42e0d8d30ba6b362d29861e717cf0fa9e89
2012-02-10 06:31:56 +00:00
Zhongyue Luo 525ba40417 Backslash continuations (misc.)
Fixes bug #925166

This patch for packages which have few backslash continuations.

Follow up patches will be for packages network, scheduler, virt,
db/sqlalchemy, tests, and api/openstack.

Change-Id: I4200010b47b33fa8b9115b5d379b543200f6668d
2012-02-08 08:52:43 +08:00
Mark McLoughlin 9871c5f963 Move cfg to nova.openstack.common
Move it here so that it can be kept in sync with openstack-common using
the new update.py script for code in openstack-common's incubation area.

See here for more details:

  http://wiki.openstack.org/CommonLibrary#Incubation

Note: this commit just moves the existing code in Nova with no other
changes. A subsequent commit will sync it with latest openstack-common
so that it is easier see the new changes.

Change-Id: If88d678b1b9bad3d37117de7f7159d7fea8ab4c8
2012-02-03 19:21:54 +00:00
Mark McLoughlin 82049af90e Refactor away the flags.DEFINE_* helpers
The next obvious step in porting to cfg is to define all options using
cfg schemas directly rather than using the flags.DEFINE_* helpers.

This is a large change, but it is almost entirely pure refactoring and
does not result in any functional changes.

The only change to note is that the default values for glance_host,
glance_api_servers and default_publisher_id options are now using opt
value interpolation i.e.

 -glance_host=_get_my_ip()
 +glance_host='$my_ip'

 -glance_api_servers=['%s:%d' % (FLAGS.glance_host, FLAGS.glance_port)]
 +glance_api_servers=['$glance_host:$glance_port']

 -default_publisher_id=FLAGS.host
 +default_publisher_id='$host'

Also note that the lower_bound check on the {report,periodic}_interval
options are no more, but this has been true since cfg was first added.

Change-Id: Ia58c8f0aaf61628bb55b1b8485118a2a9852ed17
2012-01-28 12:37:16 +00:00
Ewan Mellor 75c7c84137 Bug #835964: pep8 violations in IPv6 code
Fix pep8 violations.
2011-08-28 16:17:17 +05:30
Ken Pepple 9d7ece3f7c add rainy day test to to_global
fixed to_global to catch correct error from incorrect mac addresses
2011-08-24 16:01:48 +00:00
Ken Pepple b5bf5fbb77 added exception catch and test for bad project_id 2011-08-21 18:01:34 -07:00
Ken Pepple 326cfda8cc added exception catch for bad prefix and matching test 2011-08-21 17:55:54 -07:00
Ken Pepple 0fdbea56ba added exception catch and test for bad prefix 2011-08-21 17:52:14 -07:00
Ken Pepple 43e2ca531f lp:828610 2011-08-20 15:30:59 -07:00
Ken Pepple f4cd3a72fa added rainy day test for ipv6 tests. fixed ipv6.to_global to trap correct exception. 2011-08-20 14:55:41 -07:00
Johannes Erdfelt 3d1cef9e56 Reduce indentation to avoid PEP8 failures 2011-05-16 20:06:49 +00:00
Johannes Erdfelt 428dc895a3 PEP8 cleanups 2011-05-16 19:33:18 +00:00
Johannes Erdfelt 6d140b61cd Add test suite for IPv6 address generation 2011-05-12 18:41:22 +00:00
Johannes Erdfelt 33466d3ca0 Accept and ignore project_id 2011-05-12 18:40:56 +00:00
Johannes Erdfelt d2b8350a02 Implement IPv6 address generation that includes account identifier 2011-05-11 21:04:40 +00:00
Johannes Erdfelt 43fa5afac9 Abstract out IPv6 address generation to pluggable backends 2011-05-11 15:12:12 +00:00