As part of the split of functional and unit tests we need to isolate
the unit tests into a separate directory for having multiple test
targets in a sane way.
Part of bp:functional-tests-for-nova
Change-Id: Id42ba373c1bda6a312b673ab2b489ca56da8c628
Since cells use oslo.messaging to specify and store the message queue URL,
multiple hosts can be specified by manually modifying that URL in the database.
However, there is no way to specify multiple hosts during cell creation phase.
This patch adds a --broker_hosts option to `nova-manage cell create` command,
which is analogous to the rabbit_hosts option in nova.conf and can be used to
specify multiple message queue servers as a comma separated list. Each server
is specified using hostname:port with both being mandatory. The existing
--hostname and --port options continue to remain but are only considered if no
--broker_hosts is specified.
Internally, each host is converted to a oslo.messaging.TransportHost
and added to the generated TransportURL.
This patch also adds unit tests for creation of the TransportHosts from
user given input.
Change-Id: I14de860b1d12f3e2c0169b58651d580792d6ce0e
Closes-Bug: 1178541
The nova-manage flavor sub-command was deprecated in Juno milestone-1
via commit a601556684 with a note that it
will be removed in Kilo.
This removes it.
Change I4e2399f2fbab2c20299dd62c104b9220c1d36fb2 is to remove the
related Tempest tests.
Change-Id: I1798c8a0697009b3dcebeb818580c8323880e395
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
Both H305 and H307 are part of the OpenStack style guide.
Ensure that there are 3 groups of imports, stdlib,
third-party and project specific. Within each category
ensure that imports are in alphabetical order.
Change-Id: Id4994551c135c3c1a4982153f0c6cacba6176b95
The following replacements were done in tests to have
clearer messages in case of failure:
- assertTrue(* == *) with assertEqual
- assertTrue(* != *) with assertNotEqual
- assertFalse(* == *) with assertNotEqual
Change-Id: Idbb1a292cf8545b87728fa2b815c67f923ef6efa
* Allow to specify vlan tag when create nova network, the dest of vlan
option should be 'vlan' instead of 'vlan_start'
* Provide new option 'vlan_start' when create nova network
* test case is updated.
DocImpact
Closes-Bug: #1288609
Change-Id: I8dd858e4cf17d8f689613554d1fbc3e56f220886
If a unit test does not call utils.reset_is_neutron() when
it is complete, it may introduce a race condition because
the utils.is_neutron() value is cached to the old result.
This patch removes the utils.reset_is_neutron() and instead
makes sure that we never have a cached value for it. It
also refactors _is_neutron out of vmwareapi.VMOps because
it cache the result unnecessarily.
Change-Id: I2440e308b00979b31c750513d14608808a295c33
Closes-Bug: #1309043
When using nova-manage with neutron v2 API, all CRUD operations
should be done directly against the neutron API, rather than
using nova-manage.
Change-Id: I663bd06eb50872f16fc9889dde917277739fefce
Closes-Bug: #1019895
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
This makes nova-network manager use the Network object for the
remaining single-item "get" queries.
Related to blueprint nova-network-objects
Change-Id: I6b1764e3c95337982cf4fbf503ddcb755e33cf2b
The method assertEquals has been deprecated since python 2.7.
http://docs.python.org/2/library/unittest.html#deprecated-aliases
Also in Python 3, a deprecated warning is raised when using assertEquals
therefore we should use assertEqual instead.
This is part of blueprint assertequal
Change-Id: I5ecb36332b9353b7010a4f977813ff0295738014
Using assertTrue and the 'in' operator to test
if an element is in a sequence is too python2.4.
Our unit testing framework supports assertIn,
which was created for these types of tests.
Adapting assertIn will enhance the readability
of the test scripts.
Change-Id: Ib44d57e75238691234c5290d13c54c526a6ae64b
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
Make it clear that we are only using the term flavor now.
Partially implements bp flavor-instance-type-dedup
Change-Id: Ic26349d70fd99a20635f3ae45041c66b300a0513
We are removing instance_type as a synonym for a flavor. This fixes that
for the db.ap.
Partially implements bp flavor-instance-type-dedup
Change-Id: Id41b3b86a7af476622c70415080f4982c267a646
nova.db.fixed_ip_get_all_by_instance_host was removed in commit
bb867ce394, but was still used in
nova-manage. This patch works around the removal of the foreign
key that led to this method being removed.
Resolves bug 1163660.
Change-Id: Ieccd37c752e245558827615c098604d11ad3d945
As part of the move of plugins to entrypoints, take advantage of the
entrypoints based console scripts, which will make our command line scripts
available for unittesting.
Part of blueprint entrypoints-plugins
Co-authored-by: Michael Still <mikal@stillhq.com>
Change-Id: I5f17348b7b3cc896c92263dd518abb128757d81f
Fixes bug #1163394
Formerly if we tried to create many millions of floating IPs with a
range like "192.168.2.224/2", address_to_hosts would happily iterate
over all of them (which would take a long time) and then nova-manage
would eventually crash with an OutOfMemoryError when we tried putting
all of them in a list. Or, if the initial list wasn't quite big
enough to use all memory, it would blow up later (even more slowly)
when we tried to put them in the database via SQLAlchemy.
Now, raise exception.InvalidInput if the number of IPs is a million
or more. (A million is erring on the side of caution.)
Change-Id: Ifc6b6a8faadc2e97e09f9f6c975e52229f705789
We need show all the quotas related info, including 'in_use' and
'reserved'--not just the limit--when executing 'nova-manage project
quota'.
Fix bug 1160752
Change-Id: I25e10e58c6af705e2189550ad762e6f39bca342e
* max_rows must be positive
Provide a better error message of 'nova-manage db archive_deleted_rows
--max_rows=' is negative.
* Requires a max_rows
* No hidden default of 5000
Fix bug 1145609
Fix bug 1151064
Change-Id: I9078ff2700a0329ac4aff68bb434be5f16a5a3f1
* Remove volume calls from nova.db.api
* Remove volume calls from nova.db.sqlalchemy.api
* Remove tables from nova/db/sqlalchemy/models.py
* Remove Xen Storage Manager Volume Driver code
* No migration to preserve data in unused tables
* Remove quota support for volumes
DocImpact
part of bp delete-nova-volume
Change-Id: I2c82c96d67f3746e5de28f917dd8ceb0c8037e27
nova-manage doesn't validate the key value supplied to
update the quota, as a result unnecessary records will be
created in db and user will be under the impression that
quota value got updated.
This patch validates the input value given to the key.
fixes bug 1064359
Change-Id: I9928f30881aa2780a23005b5f69aa67a44f314c5
Updates quota value to -1 in db rather than None
if the user specify the quota limit as "unlimited".
Fixes bug 979087
Change-Id: I0ec412189ad9630c4a875655294c1e77886108f5
Implements blueprint os-api-network-create
The ability to create new networks is currently only exposed by the
nova-manage CLI. Here we add support for network creation in the
os-networks API extension.
With the exception of num_networks and network_size, all the parameters
supported by 'nova-manage network create' are supported. Only a single
network may be created by each API call.
To avoid code duplication, the nova-manage code is refactored and moved
into NetworkManager so that it can be re-used by the API.
DocImpact
Change-Id: I682d498ab35ea43b553b64e13e677fe9eeb8e08b
bug 1031263
The nova database API use instance_type id as parameter to access flavor
extra spec. However, the flavor extra_specs API extension use flavor_id as
parameter wrongly.
As the instance_type ID is a purely nova internal ID, the database should
not expose it and instead use flavor_id as the parameter
Change-Id: I5f509cb7c4457d8c399df32f559a874d498be762
Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
blueprint update-flavor-key-value
Enhance nova-manage so that it can add, delete and list key/value pairs for
flavors extra specs.
Change-Id: I0665bec6aecd7f7a1d8e845fd930f4bd5a841522
Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
Fixes bug 1017682 the netaddr.IPNetwork.iter_hosts
method doesn't return any IPs when /32 or /31 and
should throw an exception instead of silent error
Change-Id: Id8875b6016a4dbb40b29d2f7687e6c35491e0129
Drop support for management of deprecated auth by deleting
the following nova-manage commands:
* role *
* export *
* project/account * (except scrub and quota)
* shell export
* user *
Additionally, delete relevant documentation and tests.
Related to bp remove-deprecated-auth.
Change-Id: Iad9787f696cb55d4673d68fc60851c7f5bd25805
Fixes bug #969208
When using noauth, a user's password is her user id (e.g. in novarc).
When we export to keystone, we should make sure the same credentials
keep working rather than effectively switching all the passwords to
random UUIDs which users would never have seen before.
Change-Id: Ie77c622ce1952d03e836bb64167184022a02e902
test.TestCase already sets up self.mox and self.stubs as well as calling
self.mox.UnsetStubs(), self.stubs.UnsetAll(), self.stubs.SmartUnsetAll()
and self.mox.VerifyAll() during tearDown.
Change-Id: I74f0824ca1e8daa7b0ee7d7a62b226ba51206e6f
* Introduce ability to dump auth data to json blob for consumption by keystone
* Implements bp keystone-export-rewrite
Change-Id: Ic8c0ade8350daa449fb6df7ad3c55c3ae2b0c2c7
This introduces a new flag "quantum_use_dhcp=<boolean>" which indicates whether
or not to enable dhcp for all of the networks. If it is set then we start
dnsmasq (and provide it with the IP/MACs from Melange) similar to how this was
done in linux_net before.
Prior to this if you enabled dhcp then you would also get a gateway device..
some people may not want that so we now require that you specify the gateway
when creating the network in order to end up with a device that will act as a
gateway. If you're using Melange IPAM and you don't specify the gateway you
still end up with one because it doesn't allow you to not have one. This lays
the groundwork for the option of not having one in the future, at least :)
Also, fix quantum/melange ipam interaction
We now query for the subnets by net_id/vif_id instead of searching through all
the blocks to find the right one. Both of the allocate and deallocate for
instance calls are now using the vif_id -> network_id mapping instead of
searching the quantum networks. get_port_by_attachment was also changed to
take a net_id so that we don't have to search through all of the quantum
networks to find the corresponding port.
Change-Id: I6a84da35237b6c5f5cdee91ada92642103439a97
With melange it will be possible to have overlapping cidrs so it would be
better to specify the uuid of the network to delete.
Change-Id: I6781225d587952cbab3387cd40164d8ac77c58d6