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
There is discussion on the mailing list about ceilometerclient removal
that started this.
The metric service is not an OpenStack service. It does not have an
entry in service-types-authority, nor does it have an API documented at
developer.openstack.org/api-ref.
That's not saying that someone couldn't install it in their OpenStack
cloud and that doing so is a bad idea. It's probably a great idea and
those people are likely quite happy.
Since this is openstacksdk we need to draw the line somewhere. The
add_service patch adds the ability for consumers to opt-in to
non-official services. Making an openstacksdk-metric package people
could use with a MetricService object and the proxy/resource objects
here would be a great idea.
As a follow-up we should potentially add the ability to add a list of
extra services to a clouds.yaml file.
Change-Id: Ib3810e3b11dbacc0215d486397e05370a2d7521e
This patch re-enables the octavia functional tests for openstacksdk.
This patch fixes a bug in the l7rule l7policy URI parameter.
This patch also fixes the test_inventory functional test that fails if
there are multiple networks in the tenant.
Change-Id: Iacdc92ec78a9ca0ad3a82172f426ed91a4b9023d
These are optional for in-repo config. Remove it. (It'll make renaming
to openstacksdk easier in the future, too)
Change-Id: I224067aba1e48756cc6ab2d804bcba6a1ba016d0
split docs requirements out into doc/requirements.txt and change the
helper tox docs env to be what the gate is going to be running.
As part of doing this, we can re-enable the enforcer code. However, it
doesn't seem to be working, so leave it as info rather than warn for
now.
Set the jobs and the tox env to use python3. The enforcer module wants
to use ifilterfalse/filterfalse which have different names in 2 vs. 3.
There's no reason to NOT run sphinx in python3.
Change-Id: I358db11b130b909084f7a9e8925477e931d87117
It's super important that changes to openstacksdk don't break
python-openstackclient. Run openstacksdk's unit test tips jobs to make
sure we don't.
Change-Id: I8059ff058835e658c8192c46f6512de1f9ea3152
Depends-On: I599b18218c10cb08e508cca3b3bbc9c88b8f809c
The basepython line was causing the py35 tests to actually run under
python2. Whoops.
It was doing the same to pypy. Add pypy to bindep with the pypy tag.
Cryptography and the version of pypi in xenial are incompatible, so
update the pypy job to run on fedora-26 instead, which has a new enough
pypy.
Shift the line so that it only applies to functional and ansible tests,
since that's where it's used.
Depends-On: I7c22e23b73ddfc18ee28e87d34d1988417b49ccb
Change-Id: Ia27a0aa0633dcf48c1bab06b3c803f996eae9efa
These aren't actually testing openstacksdk in any way at the moment,
and having them is making us have a test-requirements depend on shade
which will make adding openstacksdk as a shade requirement a circular
dependency.
Remove them for now. To re-add them, we want to:
- add openstacksdk as a shade requirement
- update ansible to import openstack instead of import shade
Once that's done, we can add the tests back, but without adding shade as
an sdk test-requirement. That way we can have shade test that the
ansible modules work if someone installs shade and doesn't explicitly
install sdk, and we can have sdk test that the modules work if someone
installs sdk and not shade.
Change-Id: Icb26f9c066bad6c2c045ac949ac1864e26b5b837
We get the devstack roles for free since we're using the devstack job as
a parent. Also, the repo location was incorrect anyway.
Change-Id: I75842ff0bb28ffed7336cf77ea9535ece9e67dc3
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
The standard in OpenStack is to use testtools not unittest. Use the base
test class which is based on testtools. This class also sets up loggers
appropriately.
unittest has an assertEqual method that is more appropriate.
Replace use of equal comparisons to None with assertIsNone.
Replace use of setUpClass and tearDownClass with setUp and tearDown.
Change-Id: Ie0f47dc7c0905164030953ba2d2633bd095782ca
These are copies of the shade jobs, but they should work with this
stack.
The changes that are not the tests are changes needed to make the tests
work.
Change-Id: I9f223c4a9ac8dc2570b8698284512e1aa834970a