There's no good reason to have the shade functions in a cloud attribute.
Go ahead and dive all the way in and make OpenStackCloud a mixin class.
There was one wrapped exception that got removed and thus the test to test
that we were wrapping it.
Change-Id: Iebd80fe5bc511ea879ea71aa88ce7d79c5e8fa58
Make a cloud attribute on Connection so that people with a Connection
can also use shade features.
This changes the default for shade's list_flavors to NOT fetching
extra_specs, which is very much yay.
Change-Id: I45a5f7f11a9c5ab3c77443a8f5df26089243334c
Although driving configuration from clouds.yaml and environment
variables is super handy for many use cases, there are also plenty where
avoiding config files or environment variables is important.
Add a flag, "load_envvars" which defaults to True but can be disabled.
Update the Connection constructor to set load_yaml_config and
load_envvars to False if a named cloud is not given.
Update the docs to make it clear which form should be used for which use
case. Also, move the profile backwards compat documentation to its own
document so that it doesn't present needless complexity to users.
Change-Id: I6e05da5e73aff4143550e1d18fb0f743d51f2b70
The end-goal here is to be able to do version discovery rather than
relying on config and in-code version defaults for what gets attached to
the connection as the service proxy for a service. However, since we're
currently constructing Adapter objects at instantation time we'd have to
authenticate AND do version discovery on every service when we create a
Connection to be able to do that.
That would be bad.
Add a Descriptor class that creates the Proxy object on-demand. That is,
when someone does "conn.compute", a Proxy will be created and returned.
To support doing that without a ton of duplicate copy-pasta for each
service, add a metaclass to Connection which reads os-service-types and
does the import lookup / BaseProxy fallback as part of Connection class
creation. One of the upsides to this is that we can add docstrings to
the service descriptor objects - meaning that the docs for Connection
actually list the proxy objects.
While we're in here, fix a NOTE in a connection doc string and add a
reference to BaseProxy in the docs so that it'll show up in the docs
too.
Change-Id: I3bef5de60b848146fc8563d853774769d0875c65
In this patch, cluster is renamed clustering:
https://review.openstack.org/#/c/519029/
Change-Id: Ied1ab2ad3d9c00cc0ebccbafe1fcd6e8094b7371
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
Code used to pass raw sessions to Resource methods. A common way to do
that was to do thins like FloatingIP.get(conn.session, name_or_id). As
conn.session is a session.Session that doesn't work anymore.
To help ease upgrade path issues, attach a reference to the Connection
into conn.session and so that we can pull the right adapter for a given
resource back out.
Add the neutron-grenade job to verify this works.
Change-Id: Ief9a0215ea2399b91d1d03a8048e73e6d7bedd64
We have a helper method for creating a Connection from a Profile to
help with the transition. Move it to openstack/profile.py so that it
is contained with the class it's associated with.
Change-Id: I20ad8d96bd13a09afaee4401d71de7dba203682e
0.10.0 got out before we could mention the giant merge that had
happened. There's also a few things in the prelude that were just
holdovers from shade.
Change-Id: I9966027e42c84f017db3c23c74b24c311273f87a
It is useful for operators to be able to check if a cloud supports
certain extensions to know whether they can perform some API actions.
Change-Id: Ie99668173d4dc6e6b3992e496560b5b7598181a2
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
Since the list_nics* methods were changed to use raw HTTP client rather
than the ironic client, they return a dict rather than a list. Instead
of getting this:
[{'address': '00:11:22:33:44:55', ...}, ...]
We get this:
{'ports': [{'address': '00:11:22:33:44:55', ...}, ...]}
This change removes this outer dict and returns to the old behaviour of
returning a list. This affects list_nics and list_nics_for_machine.
Change-Id: I3cb9ef5d97cf911cb4897b00ab4cef77b76efaa4
Added retry logic mechanism and added them to the API calls
where ironic presently attempts to pull an exclusive
lock on the baremetal node.
Change-Id: Ia6fbc9eec612793b3214d7883e0552913a088d5d
We've finally gotten out of the business of wrapping exceptions. Since
we don't do that anymore, we don't need the log_inner_exceptions logic.
Change-Id: Id1f709daa2e61c13efeeeffc2a08578c27265e56
This function currently does not allow getting of a server
from all projects, and it can be quite useful to do so (for
various admin/operator activities) so allow get_server to
pass through 'all_projects' to the internally called
'search_servers' (and default it to false to retain the old
behavior).
Change-Id: I7b7534a044cfa0ccbaa11a635edcca388db27f0f
When cache settings are in place for ports and floating ips, we should
be doing full list calls and filtering locally. This is done to prevent
things lke nodepool from crushing clouds under the weight of our immense
need for information.
Change-Id: I304ff1c0e355bcfc00398316a296417c19e9b74f
Rather than stripping invalid query params and then
continuing the API call, lets actually throw an error
since we explicitly define what valid query params are.
This stops people from accidentally querying for an
incorrect param, getting back a list of 'everything' and
then acting on it assuming it was a valid query.
Adds a util function for getting keys from format strings
as the checking for invalid keys needs to take into account
what key may be required for the base_url.
Change-Id: If30badb4d71e521100a0e8974978eb6d5fa2699f
Adds an optional parameter to the create_network and
create_router-methods, for use with availability zone-scheduling of
network agents.
Change-Id: Ifb93a10415dc676f5cc56b5315f2dff24fc395b8
We list profile and authenticator as deprecated, but with no docs
providing suggestions as to what to do.
Add some docs.
These can be cleaned up a little bit as we continue to reorganize the
new code. For instance, you can actually do all of these just with the
Connection object, but only once we've released. Pointing people at
getting a cloud_config object for now allows writing code that will work
with both old and new interfaces.
Change-Id: I519c672d1a3905ef8695287d73fce0949576505d