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
Add an image user guide to replace the current placeholder. Also,
add image examples and related tests to go along with the guide.
Much of the content for the guide was pulled from [1].
[1] http://docs.openstack.org/image-guide/
Change-Id: I8b3a1618b09f3570f3b69d8c228bed56d4d1c151
Closes-Bug: #1466183
The functional tests use the DevStack cirros image instead of a
fedora image. Update the examples tests to do the same since
the fedora image is not available in the test environment.
Change-Id: Ib90cff818d36fa71445109c6950d79c6f1b477a7
Related-Bug: #1522919
Add an identity user guide to replace the current placeholder. Also,
add identity examples and related tests to go along with the guide.
Much of the content for the guide was pulled from [1].
[1] http://docs.openstack.org/admin-guide-cloud/identity_management.html
Change-Id: Iec3caf601732c5c6f63331eac770d1325051aa82
Closes-Bug: #1466182
Add a network user guide to replace the current placeholder. Also,
add to and update the network examples to go along with the guide.
And finally, add a test for the network examples.
Change-Id: Ib98a7632c3ccc9764a93831f0dbe597ce0bce606
Closes-Bug: #1466186
This change allows the from_config factory function to better support
two angles from which it will most commonly be used.
1. When SDK is being used from within OSC, OSC will have obtained
configuration data from OCC and is better served by passing it directly
into SDK rather than SDK additionally accessing that data.
2. Direct users of the SDK, such as customer applications, are less
likely to have dealt directly with OCC and are better served by just
passing in the name of the configuration they want to run with.
Closes-Bug:1513920
Change-Id: I06f871b822e4b8b0cc8cc8db9e7ccff91f918e5a
It's much more straight-forward for users to read a create server
example that does everything necessary to create the server
within the body of a single method. In this better example the user
doesn't have to refer to other examples to learn how to create a
server.
Change-Id: Iad7eef7946e93deb735fddcfbe39bbc8b56f507b
The beginning of the compute user guide.
This also begins the simplification of the examples, makes them
more specific, and adds testing.
Change-Id: Ic4bac2fe30601c196b03ce73b2dd04a916231f33
Partial-Bug: #1487269
Partial-Bug: #1419012
Partial-Bug: #1466180
Everett mentioned cleaning up the example code and I'd like to
start this by removing the command line options. There is a lot
of complexity there I'd sooner not maintain. I'm pretty sure
some of it is broken. It is also different than other CLIs.
Use OCC.
Change-Id: If759e02ede4baee5277c1a8a4bc9f2dca13f6c82
While these methods are cool short cuts and work in a lot of
cases, I think they will cause problems and confustion. The
proxy is respsonsible for hiding some API inconsistencies and
this by passes that.
Change-Id: Iafaf2b035d0c3a0f342ca5f66baaddfaf624404e