Importing munch inside of SDK is taking around 0.3 second. Itself it is
not a big problem, but it hurts on the openstackclient front. In
addition to that munch project does not seem to be actively maintained
and had no releases since 2 years.
Dropping this dependency at once is requiring quite a big rework so
instead copy a heavily stripped version of what we really require from
it. This helps us to gain performance improvement while giving time to
rework our code to come up with a decicion on how to deal with it.
Change-Id: I6612278ae798d48b296239e3359026584efb8a70
Importing pkg_resources scans every installed distribution to find
all of the entry points. importlib.metadata can import entry points
without scanning all of the installed packages.
Change-Id: I9917b10292d191710b37838b3cf099d75139f123
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Remove requirements only needed by Python prior to version 3.5.
Remove python 2.7 code from setup.py.
Remove from setup.py ancient sections.
Change-Id: Ie223b743a0f8def53874bfbbb5f9000ad26f030b
This partially reverts commit b6a22e3749555ecf9fea762dfc4935e312f6d8bb.
The addition of futurist as a hard depend broke python2, and at the
same time didn't mark the release as having done so. In looking at the
issue we realized that we don't actually need the hard depend.
Change-Id: I2d874f618f5b3f66d49cd2e964c6e05655f22c0f
As we're being used inside of services more and those services
frequently use things like eventlet, allow people to pass in
an Executor object from futurist to override the default
ThreadPoolExecutor object.
Change-Id: I6c04defc28998d49199383a6cc6d5f5611a99e25
decorator.decorate decorator is only implemented in decorator 4.0.0.
The current lower bound of decorator is 3.4.0 but it does not work
with openstacksdk. It is found during a OSC change [1].
This commit bump the minimum version of decorator.
It looks like that decorator 4.0.0 works but we now test with
decorator 4.4.1 (the latest version),
so I chose the latest version as the minimum version.
[1] https://review.opendev.org/#/c/674325/
Change-Id: I7479a84ef19c7f1e881b9d56c12d2798340eb53b
The library dogpile.cache is not compatible with Python 3.7 until
version 0.6.5 because of new reserved word 'async'.
For more info please check:
3c4351c11f
Change-Id: I851ed4ec14cb0a97c9acc38f77cdab6f269ed40c
A new keystoneauth release is out that fixes authenticated
discovery, meaning we'll pick up new server microversion,
which means we can start testing for such in our server
functional test.
Depends-On: https://review.opendev.org/690876
Change-Id: I51b7fd28f3469a5718057ece2f29f3655ef717e4
Because we should always be tracking to the latest ksa anyway, but
also...
...to allow from_conf to to take advantage of retry config options
introduced in [1] and [2].
[1] https://review.opendev.org/666287
[2] https://review.opendev.org/672930
Change-Id: I85669b12a6948ab5accd3d7df71dcbacce413e33
Added support for setting global_request_id on a Connection.
If done, this will cause all requests sent to send the request id
header to the OpenStack services. Since Connection can otherwise
be used multi-threaded, add a method global_request that returns
a new Connection based on the old Connection but on which
the new global_request_id has been set. Since a Connection
can be used as a context manager, this also means the global_request
method can be used in with statements.
Change-Id: I70964cdd79741703c0b9b911b3b2f27c248130f0
OpenstackSDK should always be using the latest os-service-types.
This commit bumps the lower bounds to the current latest version
(1.7.0), and adds a canary test so that the CI will fail as soon as a
new os-service-types version hits upper-constraints.
Change-Id: Ie98ec9cfd58badc2b05a2a144d1d559d7ed6553b
In the following cases, we used to happily allow the Connection to the
service, using default Adapter settings:
- If the conf section for a given service is missing, or present but
without ksa adapter opts registered.
- If the conf section for a given service has bogus values.
Now for these scenarios, we disable that service with a helpful reason.
The service disabling is supported at a broader level: If someone sets
has_{service_type} to false in their config, we remove the adapter for
that service and replace it with something that throws errors when
people try to use it. They can optionally set
{service_type}_disabled_reason to make the message more informative.
Co-Authored-By: Monty Taylor <mordred@inaugust.com>
Change-Id: I3aa1f1633790e6e958bbc510ac5e5a11c0c27a9f
This commit enables SDK consumers using oslo.config for keystoneauth1
Adapter settings by introducing a method:
openstack.config.cloud_region.from_conf
This accepts:
- An oslo.config ConfigOpts containing Adapter options in sections named
according to project (e.g. [nova], not [compute]). Current behavior is
to use defaults if no such section exists, which may not be what we
want long term.
- A Session. This is currently required - if unspecified, a
ConfigException is raised - but in the future we probably want to
support creating one (and an auth) from the conf.
- Other kwargs to be passed to the CloudRegion constructor.
The method returns a CloudRegion that can be used to create a
Connection.
Needed-By: blueprint openstacksdk-in-nova
Co-Authored-By: Eric Fried <openstack@fried.cc>
Change-Id: I05fb4da39d2eefc91828ace02db2741b62a2cb0a
We need to cut a quick release for masakari and this is a bit
much to have in a quick release.
This reverts commit c9b60f2b8634c7f8c4254e158cc921202538db04.
Change-Id: I4771ee4136e54f22979e159932f36040397d4d4c
We've added concurrency and rate-limiting controls to keystoneauth. That
means we don't need to do them in openstacksdk.
Depends-On: https://review.openstack.org/#/c/640389/
Change-Id: I5d7bd12606785365d2f5b5b52ec7a2316459b68f
Unpin dogpile.cache, we can use 0.7.0 and later now.
Story: 2004605
Task: 28502
Needed-By: https://review.openstack.org/#/c/624993
Change-Id: I1cbf4897f8f55376a85a8f760b683ebb778c5bb9
Latest release of dogpile.cache breaks our method of calling a bound
function in the decorators. For more details see story or
https://github.com/sqlalchemy/dogpile.cache/issues/140
Pin while we work on a solution.
Additionally, the cirros version was updated to 0.3.6 in devsatck with
Id2f20ebafdd78c2dadf81b8f80f22e7bd6db7755. Update the hard-coded
versions in the functional tests (this should be modified to be more
version agnostic in a future change)
Story: 2004605
Depends-On: https://review.openstack.org/624697
Change-Id: Id2df8a05ef45041bf55a2671f7d06e7b88cc79d6
We're really close to a 1.0 release. Let's go ahead and remove the stuff
that was marked deprecated and see what breaks.
Depends-On: https://review.openstack.org/610695
Change-Id: I0b1b7a0060a3cc0ac1772e5ef2d2a9673159cd77
Since the dawn of time we've labored under the crippling burden of
needing to explicitly request a version via configuration in order to
get a usable handle to the cloud. This is despite the hilarity of the
existence of a system for discovering available versions since basically
the beginning of the entire OpenStack project.
Today we shall be liberated from the tyranny of terrible past life
decisions on the part of our forefathers and shall usher forth the
shining freedom of actually using the discovery system.
Change-Id: I11c16d37d3ab3d77bed3a0bcbd98f1fa33b9555f
Openstacksdk is extended with a signature generation functionality.
This adds cryptography to the requirements and lower constraints.
Change-Id: Idc15b9a12d408bd4b2e096da8402c374be56f9fa
Story: 2002128
Co-Authored-By: Markus Hentsch <markus.hentsch@secustack.com>
Based on discussion with the API-SIG, we determined that if someone sets
*_api_version or OS_*_API_VERSION to a value that looks like a
microversion, we should pass it to default_microversion in addition to
using it for major version discovery.
Update the docs to reflect the microversion story (and to remove shade
references)
Also, throw an error on missing support for default microversion
We've given the user the ability to set a default microversion. However,
that microversion might not be available on the cloud in question. Throw
an error in such cases.
Depends-On: https://review.openstack.org/568640
Change-Id: Iad7194dc9e933660c0d0df9130c51d505dda50cb
keystoneauth has support for service type aliases and version discovery.
Stop doing it locally and just pass data to keystoneauth.
Depends-On: https://review.openstack.org/567602
Change-Id: If60d02a8216ca0719fa628431515a0c3b37bf607
This is a large and invasive change to the underlying guts. Most casual
use should not notice a difference, but advanced users, especially those
using the Profile or Authenticator interfaces or making use of pluggable
providers will be broken.
The overall intent is to align directly on top of the mechanisms that
came from os-client-config for config and to use keystoneauth1's Adapter
interface to make use of the canonical implementations of such things as
service and version discovery. The end goal is that openstacksdk
provides the REST interaction layer for python-openstackclient, shade,
Ansible and nodepool.
Replace profile with openstack.config
os-client-config is used by shade and python-openstackclient to read
and process configuration. openstacksdk also can use the
os-client-config interface, but translates it internally into the
Profile object. As os-client-config has been injested into
openstack.config, remove Profile and just use the config classes.
Make proxy subclass of adapter
This gives every service a generic passthrough for REST calls, which
means we can map unknown service-type values to a generic proxy.
Strip endpoint_filter
We're passing Adapters around, not sessions. Doing so means that
self.service and endpoint_filter have become unnecessary.
Rename _Request.uri to _Request.url
This is a stepping-stone to replacing _Request with requests.Request and
using requests.Session.prepare_request inside of _prepare_request.
Rename service proxy instances to match their official service-type.
Aliases are kept for the old versions, but make the canonical versions
match the official name.
Rename bare_metal to baremetal
Rename cluster to clustering
Rename block_store to block_storage
Rename telemetry to meter
Create generic proxies for all services in STA
Every service listed in service types authority is an OpenStack service.
Even if we don't know about it in SDK, we should at the very least have
a low-level Adapter for it so that people can use REST calls while
waiting on the SDK to add higher-level constructs.
The pypy jobs are happily green. Run them as voting rather than
non-voting.
Add syntatic sugar alias for making connections
Typing:
import openstack.connection
conn = openstack.connection.Connection(cloud='example')
is annoying. This allows:
import openstack
conn = openstack.connect(cloud='example')
Use task_manager and Adapter from shade
As a stepping-stone towards shade and sdk codepaths being rationalized,
we need to get SDK using the Adapter from shade that submits requests
into the TaskManager. For normal operation this is a passthrough/no-op
sort of thing, but it's essential for high-volume consumers such as
nodepool.
This exposes a bunch of places in tests where we're mocking a bit too
deeply. We should go back through and fix all of those via
requests_mock, but that's WAY too much for today.
This was a 'for later' task, but it turns out that the move to Adapter
was causing exceptions to be thrown that were not the exceptions that
were intended to be caught in the SDK layer, which was causing
functional tests of things like GET operations to fail. So it became a
today task.
Change-Id: I7b46e263a76d84573bdfbbece57b1048764ed939
This sucks in the git history for both projects, then moves their files
in place. It should not introduce any behavior changes to any of the
existing openstacksdk code, nor to openstack.config and openstack.cloud
- other than the name change.
TODO(shade) comments have been left indicating places where further
integration work should be done.
It should not be assumed that these are the final places for either to
live. This is just about getting them in-tree so we can work with them.
The enforcer code for reasons surpassing understanding does not work
with python setup.py build_sphinx but it does work with sphinx-build
(what?) For now turn it off. We can turn it back on once the build
sphinx job is migrated to the new PTI.
Change-Id: I9523e4e281285360c61e9e0456a8e07b7ac1243c
Currently update_image returns unsupported media type because
unexpected Content-Type (application/json) being passed
to glance service.
Provided expected Content-Type and body with patch operations(op).
Used make_patch() method from jsonpatch library to create patch
for updating image.
Closes-Bug: #1455620
Change-Id: I3d77648d55b2870e40ff689b47574e68aa72d7f6
In auditing our proxy method names heading into the 1.0 release,
where we'll need to be more careful about backwards compatibility,
some names in the cluster proxy use structures that are different than
we're using both around the other services and also within cluster
itself. We've converged on several naming formats for add/remove,
attach/detach, and several other grammar styles when naming operations
that are done on a certain resource.
This change introduces a deprecation decorator using the `deprecation`
library, which was recently added to global-requirements. This is also
the first change of several in the auditing process, just going
alphabetical order through the services.
The plan with these is that they're marked for deprecation in the
next release (0.9.14), both here in the code and in the documentation
via the deprecation library's ability to modify the docstring, which
then shows up in our built documentation. In the meantime, we should
help any users we know of—in this case we have cluster developers on
this project—in updating calling code to use the newer format before
1.0 happens.
The following deprecations were made:
* cluster_add_nodes -> add_nodes_to_cluster
* cluster_del_nodes -> remove_nodes_from_cluster
* cluster_replace_nodes -> replace_nodes_in_cluster
* cluster_scale_out -> scale_out_cluster
* cluster_scale_in -> scale_in_cluster
* cluster_attach_policy -> attach_policy_to_cluster
* cluster_detach_policy -> detach_policy_from_cluster
* cluster_update_policy -> update_cluster_policy
* cluster_operation -> perform_operation_on_cluster
* node_operation -> perform_operation_on_node
Partial-Bug: 1657498
Change-Id: I3df0494f9ec0097aee7d47e05fb42094439bc4a4