We don't need to depend directly on python-subunit.
In python3 we don't need safe_hasattr.
We don't use testrepository.
In lower constraints, os-client-config and mox3 are
transitive depends that we do not care about so don't
need to track lower pins for them.
futures and ipaddress were removed from requirements
but not from lc.
Finally, remove future from lc and from __future__
since we're python3 only.
Change-Id: Ic22079f78f77221e83986e5a835457dbefc3ded7
This whole thing is a mess. examples is doing the right thing and
using get_extra_config, but its docs are wrong. functional is
reading config from a non-standard place but is the place that
the examples docs incorrect say it should be read from.
Update both places to read from the RIGHT location and update
the docs as well. Make examples support setting a key to use
and then set that key in tox so that we can just use the
functional settings for both.
Also, fix the clustering functional test so that it consumes
the IMAGE_NAME discovered in functional.base.
Change-Id: Ia9f150bbdd3825cb3e0d4282af3ca8f23dc1d888
The openstacksdk docs are published at docs.o.o, not developer.o.o since
quite some time. Fix links to point to current version of docs.
Add missing links, thus removing some TODOs.
Change-Id: I5e3b4c70bc0875a1dfcc587b60a95258a61b4407
In examples/connect.py, openstack.connect api call requires
user_domain_name and project_domain_name as a required args
which was missing lead to api failure while connecting to
openstack cloud.
It fixes the same.
Story: 2006281
Task: 35984
Change-Id: I79d977282f4bc7699957a0275d251b75c2642cc2
Signed-off-by: Amol Kahat <amolkahat@gmail.com>
The documentation for using the built-in CLI parser are incorrect, this
updates them for very functional and simple ones.
Change-Id: I0cc17b46c85aadc1fd30c5a55021bfeb1f7366f0
Add support for the DNS service. There are still some unimplemented
resources (tld, pools, limits, tsigkey, blacklist, quota,
service_status). They would be added in the follow-up, since this change
is already very big for a review.
Change-Id: I4acab7c4cace63b4ea7d719854e159bd41d49039
Interoperable image import process are introduced in the Image API v2.6. It
mainly allow image importing from an external url and let Image Service
download it by itself without sending binary data at image creation.
This commit will add a method import_image in both Image resource and proxy.
I also add a simple create_image proxy function for creating an image without
uploading it's data, as it is not required in glance API.
Change-Id: Idee9bea3f1f5db412e0ecd2105adff316aef4c4b
Story: 2005085
Task: 29671
Devstack has updated from 0.3.6 to 0.4.0, since we still hardcode
things, we need to follow them.
[0] https://review.openstack.org/521825
Change-Id: I5ed1bb70f6f14f79a31b7c98eedfbe2956044036
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
The latest flake8 checks strings for escape chars, and also has a new
and better rule about line breaks before binary operators - which is
what knuth says should happen.
The escape char check was catching some asterisks in docstrings that
weren't actually providing much, since we already list type as "kwargs".
Just remove them.
Install latest flake8 so we can gate on this.
Change-Id: I89088adcc6f4ff5a894df5e677ae9b28a58edd9a
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
This change adds set_provision_state and wait_for_provision_state
to openstack.baremetal.v1.Node, as well as set_node_provision_state
to the bare metal Proxy. Also adds wait_for_nodes_provision_state,
which is similar to Node.wait_for_provision_state but handles several
nodes at the same time, which is important for bulk operations.
The cloud's node_set_provision_state was updated to use the new calls.
As a nice side effect, it now supports all provision states and actions
up to the Queens release, as well as does proper microversioning.
Some documentation was written for the bare metal proxy.
Change-Id: I22a76c3623f4dd2cca0b2103cbd8b853d5cebb71
The examples tests are currently not being run, which means they're
probably broken. Move them into the functional test dir so that they get
picked up when we run functional tests.
Change-Id: Id4dc9d48544134f304c2d2a0a292c04184316d70
We don't want these where they look like supported interfaces just yet.
Move them below openstack.cloud.
Change-Id: I653e5aaba8084e8c226fd0e787dfff01050e7a6c
shade and openstacksdk each have a logging doc and a logging setup helper
function. They both basically do the same thing, and we have a TODO item
about collapsing them.
This moves openstack.utils.enable_logging to openstack.enable_logging
(leaving behind a compat piece at openstack.utils.enable_logging) It
adds the shade functionality to it, and also changes the behavior to
match shade's WRT behavior when no parameters are passed (defaults to
logging to stdout)
Update the codebase to call openstack._log.setup_logging instead of
logging.getLogger directly, as setup_logging attaches a NullHandler by
default.
Collapse the docs into a single document.
There were only two places where openstacksdk was already logging to
something other than 'openstack'. Collapse those down to 'openstack'
until we come up with a reason to break them out more logically.
Change-Id: I45fd5ffd18255450d38a1f56c80f5c157ea19ae3
The openstack doc standard location is 'user', so go with that.
Incorporate pages from the shade and occ docs into the appropriate
places in the user index file.
This still leaves user/logging and user/guide/logging which need to be
rationalized. That will come in the next commit, as it also needs to
actually rationalize the logging helper functions.
Remove the Makefile, as it's not used by things.
Change-Id: I26f36370ef9651f4bcaa7dee3b903309463d9592
The name CloudConfig has always sucked. While working on the next patch,
it occurred to me that what a CloudConfig represents is the config for a
given region of a cloud. We even reference "Cloud Region" as a unit of
work when giving conference talks.
Take the opportunity while we're doing this sdk/occ merge to rename it.
Obviously we can provide naming compat shim in OCC itself.
Leave in *some* naming compat shims to get us past the 0.10 release so
that OSC continues to have the happies.
Change-Id: Ia0bbc20eb28a3a36e69adba3a4b45323e4aa284e
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
* Check service availability for swift, heat and octavia
* Use OS_CLOUD=devstack-admin. DevStack sets up default clouds.yaml
for member and admin roles. The current OpenStackSDK functest prepares
its own clouds.yaml based on DevStack admin account, so there is no
difference from 'devstack-admin'. It simplifies the post_gate_hook process.
* Skip openstack.tests.functional.network.v2.test_quota.TestQuota.test_set
(Related-Bug: #1687202)
Change-Id: I571e437dd7e439d2ad8a1d7ed9a5a24361b1308e
I forgot to `git add` this file to the
Ie62ebcc895ca893321a10def18ac5d74c7c843b9 change and recently noticed it
causing `tox -e pep8` to fail locally.
Change-Id: Ib80eda80f27457f2db2672d58c4a6c4a7ecd3d7c
The image used for functional tests is out of date. This simeple
changes gets more tests to pass.
Change-Id: I60967b6da183ae88270c541abdb4d93913f45558
Partial-bug: #1665495
The Network proxy contains two methods that are mostly there for example
purposes: security_group_allow_ping and security_group_open_port.
They haven't been included in documentation due to missing docstrings,
and they aren't used anywhere in the SDK or within OSC. They're better
off as actual examples in our documentation than being within code that
we need to support throughout the future.
Change-Id: I4c6b47860b0c2b952e50d4b564451780008b631a
This change adds the Role resource to Identity v3 and exposes the CRUD
methods in the proxy. It also adds a small example to the documentation.
Change-Id: I064c27fcd1d15bfd064c63b8c50bc2461b8c1156
The user guide shows that options passed to connection.from_config do
not have to be an argparse Namespace, contrary to the comments in
connection.from_config. This change corrects those comments and adds
a user guide example showing how argparse may be used.
Change-Id: I2a9e92cbf0aab16476001be772034e9698a24c9f
Closes-Bug: #1629331
This change updates the Key Manager service for the resource2/proxy2
refactoring. Along with making it work with the new classes, it improves
usability--at least temporarily--by exposing the ID value necessary from
the HREFs that the service returns. The HREF that gets returned, e.g.,
from a list call, is not directly usable to then pass it into a get
call. A more long-term fix for this would potentially be to create a Key
Manager specific base class that fiddles around with IDs and looks to
see if they are an HREF and converts them to a UUID in the proper
direction depending on where the data is going, but that's too much to
tackle in this refactoring change.
Besides updating some of the resources to match the documented
attributes, one feature this does add is retrieval of the Secret
payload, which is done via a separate endpoint. However, like other
calls in Glance and Heat, we unify them in the proxy's `get_secret` call
so the user doesn't need to know it's a separate call.
This also includes some basic docs in the user guide to show how the
different ID usage is currently necessary.
Change-Id: I8b5753e121d8f79350b38803e8aac95d7b4d1627
This is a first step to add user guide for cluster service. Will propose
more contents in patches that follow.
Change-Id: I1f9a8f45f00872c5d2f375b123260d32adaa6d66
Fix unit, functional and examples tests for [1]. Also
fix the documentation for the server image_id and flavor_id
properties.
[1] https://review.openstack.org/#/c/279618/
Change-Id: Ia37ecc7c9dccb90fabf7bf73601a6ad519212556
Partial-Bug: #1461200
This patch set updates all network resource objects to use basic
properties for ID attributes. In particular, the following changes
were made:
- Use basic *_id resource.prop for ID attributes
- Use list *_ids resource.prop for attributes containing a list of IDs
- Clarify documentation for ID attributes
Change-Id: I725095bb07da55148e29c511e7e8506bc7dbb7ca
Partial-Bug: #1461200