It's the general design of the cloud layer to return empty resources
rather than throw exceptions when a user tries to fetch a non-existent
resource.
Change-Id: I1c6ce28af767f466f349b51a47abe27c0dcdd3fb
These are new nodepool functional jobs designed to give more
flexibility to the DIB/clean projects to define what they need
to test. Otherwise, they behave very similarly to the current
nodepool functional jobs.
Depends-On: https://review.opendev.org/665023
Change-Id: I3b88debef5e92b2d2469952a5d12be8bf569102e
Change the defaults for the max of a 5 of \begin...\end stanzas,
up to a 10.
Change-Id: I52ef17bd87cbcde7f9dc34e8b1bb874581d0917d
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
Services like ironic-inspector are likely to be represented as
ironic_inspector in the configuration, so fall back to underscores
if the variant with dashes is not found.
Change-Id: I765a0722aa718ab8e430c3f8fc31c192091e9ca1
The correct remote value is "False". It's supposed to be a string.
Set it that way.
Story: #2005851
Task: #33637
Change-Id: I44b6fc9fe12422024392d60573862a646046564a
In the compute.server we are currently exposing names, which are only
"aliases" for known attributes (i.e. accessIPv4 vs access_ipv4). Since
we want to drop the _normalization completely it is necessary to expose
attributes under old used names (which are not really fitting naming
convention of the resource attributes). So add a "aka" to the
BaseComponent.
While we are here
- repair some of the resource accesses from the unittests (i.e. direct
conversion to dict),
- update local dict storage, so that json.dumps works on update
resource. Actually also fix the existing problem in the code with that.
- add _attributes_iterator to de-duplicate logic in Resource
- what a wonderful bug - passing sha256 as md5 (affects nodepool
heavily). Add also tests for that.
Change-Id: I39edfc8fe4e4f6c216663c0e7602c9f1bec5cab4
Raising a generic SDKException makes it harder to distinguish them
from other failures. Also add missing docstrings.
Change-Id: I576469b0bdb664512ce9d34d5217329f3fa62b64
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
There was previously no way to remove all routes from a router with the
update_router function because it only processed the routes if the
statement 'if routes' evaluated to True, which an empty list did not.
Modified the unit test for cloud/test_router so that it initialises the
test router with routes, and confirms that they are removed.
Change-Id: I9f31ad33eb500f59eb7634ea9e7e6502362a375b
Story: 2005089
Task: 29685
Proxy (a subclass of keystoneauth1 Adapter) is set up to know about
region_name. This is done so that consumers of cloud_region.from_conf
will have their [$project]region_name setting honored rather than
ignored.
Previously, CloudRegion was set up to deal with a single region, masking
(or rather overriding) each Proxy's notion of what its region_name
should be.
With this change, (service-specific) region_nameZ are honored by the
CloudRegion constructor, as follows:
- A service-specific region_name in the ``config`` dict (e.g.
'compute_region_name': 'SnowflakeComputeRegion') takes first
precedence for that service.
- If no service-specific region_name is present in the ``config`` dict,
the value of the region_name kwarg to the CloudRegion constructor is
used. (This kwarg should really go away, but is preserved for backward
compatibility.)
- If neither of the above is given, the value of the (unprefixed)
'region_name' key in the ``config`` dict is used. (This should really
take precedence over the kwarg, but it's done this way for backward
compatibility.)
- If none of the above exist, None is used (the previous behavior,
whatever that may mean).
This change should hopefully be transparent to any existing usages of
the CloudRegion constructor, as ${service}_region_name would have been
ignored if present. However, if any existing usages had such a config
setting present, it will no longer be ignored, resulting in potential
RBB [1].
[1] That's "Revoked Bug Benefit"
Change-Id: Ie253823a753d09d52e45df9d515fd22870c2d4c5
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
- add query params for Hypervisors
- cleanup ImageDetail and HypervisorDetail
- mark compute.images API as deprecated
- use resource layer for hypervisors from cloud layer
Change-Id: I64988e3b978b74bd095845d4ee0e5aab4f5acf95
In the cloud layer we receive multiple filters. We would like to pass as
much filters as possible to the server to reduce response size. For this
we need to know which QPs are supported by the given resource. Add
support for passing everything given to the Resource.list function and
silently skipping unknown parameters. This is not going to be a default
behavior, but primarily used from cloud layer.
Change-Id: I53854ddcb86b92acdb64fabeb1de4ea4907c4a21
- Change the config to yaml
- Set the networks on a per-region basis since the "DDoS Protected"
network is not yet available in the us-slc region, only us-dfw-1.
Change-Id: Ie231f041accb83097e7585355f4174a57d74212e
Neutron API supports qos_policy defenition during port creation and
port object already contains qos_policy_id[1]
So this patch extends port_update method with the ability to provide
qos_policy_id in the addition to existing parameters.
[1] https://opendev.org/openstack/openstacksdk/src/branch/master/openstack/network/v2/port.py#L109
Change-Id: Iad837fababa8d9d0c604637d326b1b1253f13c05
The Network class supports the dns_domain field. This change
adds in the ability to create & update networks with the
dns_domain set.
Change-Id: Ifa072138b616d2a12696b27e10556f92542c05cb
Add a link in the patch_node docstring to the corresponding baremetal
API operation, Update Node (PATCH /v1/nodes/{node_ident}).
Change-Id: Id13b1d148c7200ce78787181aa3f376372f21df6
Add possibility to pass a hook in the vendor config, clouds-public.* or
upon building a connection. This should be a string parameter - function
name to be executed. This gives possibility to register new services of
the cloud automatically or alter behavior of the present services.
It would have not been necessary, if public clouds followed
upstream-first aproach.
While we are here fix warnings on not closed files in the test_json
Change-Id: Ifd6c0847102af4f46e361dcb1a665829c77553b9
This is the same code for v1 and v2.
While we're in there, add checksum verification for when download
is used with an output file.
Change-Id: I35675fdbc29728b39ca76fc411f656e6234623a5
Next refactoring monster with:
- switch bunch of cloud._image methods to using image.proxy methods
- Add new image.Image attribute
- Fix image properties by adding global support for keeping "unknown"
attributes under properties attr
- turn back function lost in openstackcloud split (sadly not found by
unittests)
- add ability to create image without data required by OSC to switch to
SDK
- use the proxy logger
Change-Id: I9d36d3a52370d6a1040362e1d6e762146df86258