'networks' in the server request body is a list of dicts
that can take a fixed_ip, port id or network id. There are
semantic rules for the combinations of these which are checked
in the helper method _get_requested_networks. The network id
validation logic is a bit convoluted where it's placed though,
so this change cleans that up and moves it to it's own method.
Note the main difference in nesting logic. You can't request
a port and network on the same nic (dict entry in the networks
list). So the conditional logic is such that you either have a
port or a network in a single request. Before this change, the
network id validation was happening outside that conditional,
and checked a second time if port was requested before validating
the network id. Since we already have that condition, this
change moves the network id validation under the condition where
a port is not requested (so a network id must be).
There are no test changes since this is just cleaning up the code
and also shows that this doesn't change the overall results of
the validation.
Change-Id: I466f2273a4ce02279b942f7ada264a3da97dfe92
There were a few comments and suggestions for improvements in the
wording for the recent series of patches that added improved help text
to the API config options. Rather than hold up those patches, this
follow-up patch cleans up those issues.
Blueprint centralize-config-options-newton
Change-Id: I512ea8c2be383e1abef7580e32deaa40e2c76c60
This reorder's parameters.yaml to the correct sort order, and turns
the info message about incorrect ordering into a warning. After this
lands parameters.yaml changes will always require that the items stay
in the sorted order enforced by the extension.
Part of bp:api-ref-in-rst
Change-Id: Ib890d369a8b50a8cd920f7b19ef13f44b3e657df
This makes the keypair object load first from the API database,
falling back to the main database as necessary. Creates happen in the
API database only now.
Since the Instance object uses this object to patch up its keypairs
field on the fly, this adds a localonly parameter to the get method so
that we don't end up with compute nodes calling back up to the API
database in the lazy-load case. Only Instances that were created before
the previous patch will be missing keypair data, and so we're
guaranteed to have their keypairs in the main database (if at all).
Related to blueprint cells-keypairs-api-db
Change-Id: I700cf8633f694c933f17dd133fa6c84c2beac4c0
fake_imagebackend had a Raw class which was used by only a small
number of tests. This change refactors the tests to avoid the
requirement for this class by using mock.
Change-Id: Iffdc0c66f1ec4428b98fffc807af636dd491a080
Functions were passing in user_id and project_id to these functions,
but they were not being used. This change allows a subsequent patch to
drop an instance object as a function argument which has no purpose
other than to provide these unused values.
Change-Id: I844b97523b28b327e76e01ef7f16b57a415418ec
This completes the validation for the admin event interface, including
detailing the codes we currently return in the parameter list.
Because os-service was incorrectly using the 'status' key, when I
renamed status => event_status I needed to also create a
service_status to make things compile. It's accurate enough to move
forward.
Because this is really a Neutron only API, this is moved towards the
bottom of the API list, to make it clear this isn't really designed to
be used by end user apps.
Part of bp:api-ref-in-rst
Change-Id: I3ed46eec1c33a63b7a89d6d6b5eeda574effdc56
This puts in the infrastructure for enforcing the section and
parameter name ordering in parameters.yaml file. It does so through
loading the lookup table as an ordered dict, and doing compare
operations to it during initial load.
The ordered dict loading is far more expensive than straight stream
loading, so a cache mechanism for file => loaded yaml is also
added. This reduces the sphinx build time to less than it was
previously, even though we are doing more processing of the data.
Once the parameters.yaml file is made compliant, we can move these
from .info to .warn and enforce the file stays alphabetized.
Part of bp:api-ref-in-rst
Change-Id: Id30464d6326aec3ed7d82c178261d686e2509d33
Verified the API document with source for methods available
and response codes used.
Part of bp:api-ref-in-rst
Change-Id: Ic3c0dc56a905985a62d719c9d05db1cf4d1c1000
Move the s3 related options to "nova/conf/". A follow up patch will
deprecate those as they aren't used anymore since the EC2 API got
removed in Mitaka.
bp centralize-config-options-newton
Change-Id: If3994be79aa92fc0179e87c123eedb8a958f4aa9
Running 'nova migration-list --status xxxx' from the command line
results in the status being passed to the db query as unicode.
Resolves-bug: #1581382
Change-Id: I6033a84d0255a86295a5d5261641a2a235c436c9
The Glance gate pep8 job believes that there's a violation of E126
(continuation line over-indented for hanging indent). This patch
reduces the indent by 1 space so the pep8 job will be happy.
Change-Id: Idc946cb14c4b1dddc6a425ffbb6b4b3f1609a4ec