4949 Commits

Author SHA1 Message Date
Monty Taylor
0a6083b876
Merge Connection and OpenStackCloud
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
2018-01-31 11:25:21 -06:00
Monty Taylor
8483e1b139
Add OpenStackCloud object to Connection
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
2018-01-30 20:13:53 -06:00
Monty Taylor
aff2b6ab40
Ensure Connection can be made from keyword arguments
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
2018-01-30 20:13:50 -06:00
Monty Taylor
ff5b6bc0c9
Add a descriptor object for each service proxy
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
2018-01-30 19:49:41 -06:00
Zuul
426a93cd82 Merge "orchestration: fix typo in doc" 2018-01-30 22:33:41 +00:00
Zuul
9b9add7309 Merge "Update reno for stable/queens" 2018-01-30 19:09:55 +00:00
Zuul
9d23bd2aad Merge "Provide compatibility for people passing raw sessions" 2018-01-30 19:09:52 +00:00
Hunt Xu
7c5266d495 orchestration: fix typo in doc
Change-Id: I83d56c0210e1f091773dd7c0dc3d16af25d6eed2
Closes-Bug: #1706400
2018-01-30 15:16:54 +08:00
Yuanbin.Chen
a5c9aa21fd Rename unit test cluster to clustering
In this patch, cluster is renamed clustering:
https://review.openstack.org/#/c/519029/

Change-Id: Ied1ab2ad3d9c00cc0ebccbafe1fcd6e8094b7371
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-01-30 09:37:29 +08:00
Monty Taylor
163f502345
Provide compatibility for people passing raw sessions
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
2018-01-29 11:27:58 -06:00
b31ca63e6d Update reno for stable/queens
Change-Id: Ib462b04d5a3498e72b166a093cbe842642c09868
2018-01-28 23:33:57 +00:00
Zuul
26e14550fe Merge "Move profile helper method to openstack.profile" 0.11.0 2018-01-28 03:00:00 +00:00
Zuul
4600dc9b0c Merge "Add betacloud to the vendors" 2018-01-28 02:50:59 +00:00
Zuul
21df34e017 Merge "Clean up the release notes a bit" 2018-01-28 02:50:58 +00:00
Zuul
d733e544ad Merge "Add supported method for checking the network exts" 2018-01-28 02:50:57 +00:00
Zuul
8991175915 Merge "Baremetal NIC list should return a list" 2018-01-28 02:50:56 +00:00
Zuul
b917772fec Merge "Add retry logic mechanism" 2018-01-28 02:50:56 +00:00
Zuul
d14db3ccde Merge "Merge OpenstackCloud and OperatorCloud files" 2018-01-28 02:50:55 +00:00
Zuul
edc0e5876e Merge "Remove inner_exceptions plumbing" 2018-01-28 02:35:14 +00:00
Zuul
e714ba4844 Merge "Use devstack functional test base job" 2018-01-28 02:32:32 +00:00
Zuul
37cdca2382 Merge "Updated from global requirements" 2018-01-27 21:54:23 +00:00
Zuul
22c53dc261 Merge "Throw OpenStackCloudCreateException on create errors" 2018-01-27 21:38:47 +00:00
Zuul
19601b0273 Merge "Pass through all_projects for get_server" 2018-01-27 20:05:03 +00:00
Zuul
c0129612a1 Merge "Fix batching for floating ips and ports" 2018-01-27 19:40:32 +00:00
Monty Taylor
64d56d7d3f
Move profile helper method to openstack.profile
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
2018-01-27 12:42:17 -06:00
Christian Berendt
af5507626f
Add betacloud to the vendors
Change-Id: I599156ee4e2ff52e4db5669fce6cacd22447c3b0
2018-01-27 12:42:17 -06:00
Monty Taylor
aba542595b
Clean up the release notes a bit
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
2018-01-27 12:42:12 -06:00
Antoni Segura Puimedon
97827cdd3c
Add supported method for checking the network exts
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>
2018-01-27 12:38:53 -06:00
Mark Goddard
ff23cd0681
Baremetal NIC list should return a list
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
2018-01-27 12:38:53 -06:00
Julia Kreger
baef9e52bc
Add retry logic mechanism
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
2018-01-27 12:38:53 -06:00
Monty Taylor
a50a784375
Merge OpenstackCloud and OperatorCloud files
Change-Id: I4db00729eb9668baac25e722ee49263609c7dbb9
2018-01-27 12:38:20 -06:00
OpenStack Proposal Bot
ad73e46483 Updated from global requirements
Change-Id: Id1418b66d055d3efaa71825a8e1becc608e54b73
2018-01-27 18:35:23 +00:00
Monty Taylor
bd3fad7d0e
Remove inner_exceptions plumbing
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
2018-01-27 12:34:08 -06:00
Monty Taylor
5872184a69
Use devstack functional test base job
We extracted some of our functional base job to the devstack repo.
Consume it.

Change-Id: I0b5172384ed1f4017d4f4ada7f4dadc5593f14be
2018-01-27 12:29:58 -06:00
Monty Taylor
63f41e8842
Throw OpenStackCloudCreateException on create errors
The exception is OpenStackCloudCreateException, not
OpenStackCloudCreationException.

Change-Id: Ia1bad2e279ed472d93c818d07a1d6de8723ab151
2018-01-27 12:29:57 -06:00
Zuul
411f0da927 Merge "Remove 'conditions' section in heat stack template" 2018-01-27 00:05:47 +00:00
Joshua Harlow
07c8649931
Pass through all_projects for get_server
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
2018-01-26 08:25:40 -06:00
Monty Taylor
586fca4b5d
Fix batching for floating ips and ports
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
2018-01-26 08:25:01 -06:00
Monty Taylor
7d8152c471 Merge "Implement availability_zone_hints for networks and routers." 2018-01-25 16:31:19 +00:00
Zuul
928b1d9687 Merge "Raise error when supplying invalid query params" 2018-01-25 03:00:10 +00:00
Zuul
dc8ade94e5 Merge "Add some docs about not using Profile" 2018-01-25 02:52:07 +00:00
Zuul
3137edcf89 Merge "v2 image update fix" 2018-01-25 01:53:22 +00:00
Zuul
074b2b3853 Merge "Adds get encrypted password support" 2018-01-24 23:57:10 +00:00
Zuul
e9b693c635 Merge "Do not apply format expansions to passwords" 2018-01-24 23:48:05 +00:00
Adrian Turjak
be8a3c651e Raise error when supplying invalid query params
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
2018-01-25 12:11:08 +13:00
Trygve Vea
861446ba20
Implement availability_zone_hints for networks and routers.
Adds an optional parameter to the create_network and
create_router-methods, for use with availability zone-scheduling of
network agents.

Change-Id: Ifb93a10415dc676f5cc56b5315f2dff24fc395b8
2018-01-24 16:31:15 -06:00
Monty Taylor
f39ae3d33a
Add some docs about not using Profile
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
2018-01-24 16:18:49 -06:00
Zuul
2f516a8db4 Merge "Add resource2/proxy2 wrappers with deprecations" 2018-01-24 21:25:46 +00:00
Zuul
f2eabbc237 Merge "Rename resource2 and proxy2 to resource and proxy" 2018-01-24 21:25:44 +00:00
Zuul
d0d0222ba0 Merge "Remove resource and proxy" 2018-01-24 21:25:42 +00:00