5882 Commits

Author SHA1 Message Date
Monty Taylor
983cc997ff Return empty lists for resources if neutron doesn't exist
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
2019-07-09 11:35:58 -04:00
Zuul
7935cf00a1 Merge "Increase randomness in ZONE creation" 2019-07-05 19:01:36 +00:00
Zuul
a813a6a322 Merge "Allow deeper levels of nesting for pdf builds" 2019-07-05 17:43:31 +00:00
Rodolfo Alonso Hernandez
9ad9da5411 Increase randomness in ZONE creation
Increase the randomness in the name generation, to avoid problems
like in [1].

The "tearDown" definition is removed from "TestZone" class. This
method is not needed, as long as "addCleanup" will always ensure
the DNS zone is deleted.

[1]http://logs.openstack.org/04/668304/7/check/openstacksdk-functional-devstack-networking/1416912/testr_results.html.gz

Change-Id: Ibc130d57596b85310a7d53d40610a470777f9b84
2019-07-05 15:42:49 +00:00
zhufl
0a5bc18977 Fix invalid assert state
In self.assertTrue("the_alt", Test._alternate_id()), assertEqual
should be used.

Change-Id: I29278908645e59b77607b71387a54ff9d0fa878e
2019-07-03 14:43:35 +08:00
James E. Blair
3f6043796d Replace nodepool func jobs
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
2019-06-27 10:18:05 -07:00
Bogdan Dobrelya
e8afa6878f Allow deeper levels of nesting for pdf builds
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>
2019-06-24 16:30:15 +02:00
Zuul
d488e44cb4 Merge "Use Resource layer for the compute Hypervsors and Images" 2019-06-21 15:35:51 +00:00
Dmitry Tantsur
b94a8ce4a9 from_conf: fix handling service names with dashes
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
2019-06-17 13:17:18 +02:00
Zuul
b0501643b9 Merge "Use Resource layer for network SecurityGroups" 2019-06-13 12:38:38 +00:00
Zuul
73c503ea3f Merge "Support deleting all routes in update_router" 2019-06-13 08:55:49 +00:00
Zuul
442f6bbde3 Merge "Add access alias (aka) for the resource attributes" 0.31.1 2019-06-11 17:06:55 +00:00
Zuul
b22f1cf67f Merge "Set xenapi_use_agent to "False" instead of false" 2019-06-11 16:52:49 +00:00
Monty Taylor
fdf43169e3 Set xenapi_use_agent to "False" instead of false
The correct remote value is "False". It's supposed to be a string.
Set it that way.

Story: #2005851
Task: #33637
Change-Id: I44b6fc9fe12422024392d60573862a646046564a
2019-06-11 08:22:15 -05:00
Artem Goncharov
9736d239d5 Use Resource layer for network SecurityGroups
Move SecurityGroups logic from the cloud layer to resource.

Change-Id: I27d910dc717182a3f9879a1f3b99c1a0760a21ed
2019-06-11 11:35:15 +02:00
Artem Goncharov
402c9f7361 Add access alias (aka) for the resource attributes
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
2019-06-08 10:46:16 +02:00
Zuul
790fc14099 Merge "Use Resource layer for compute AZ and Aggregates" 2019-06-07 13:25:46 +00:00
Dmitry Tantsur
f4fa6fabba baremetal: raise more specific ResourceFailure in wait_for_* methods
Raising a generic SDKException makes it harder to distinguish them
from other failures. Also add missing docstrings.

Change-Id: I576469b0bdb664512ce9d34d5217329f3fa62b64
0.31.0
2019-06-07 11:27:21 +02:00
Eric Fried
f7860861a1 Pin to latest os-service-types
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
2019-06-06 15:57:25 -05:00
Zuul
f7a401d4e5 Merge "Minor fixups from from_conf changes" 2019-06-06 20:50:22 +00:00
Zuul
1cca76232d Merge "Add release note for new disable service functionality" 2019-06-06 20:50:21 +00:00
Zuul
e64523b575 Merge "Handle oslo.config exceptions in from_conf" 2019-06-06 20:50:20 +00:00
Monty Taylor
3bac4abbda Add release note for new disable service functionality
The behavior of disabling a service has changed slightly.

Change-Id: If7ee3aed6696308d15932c31f2ffb14486b30889
2019-06-06 17:30:06 +00:00
Eric Fried
879f7d4f12 Minor fixups from from_conf changes
Addresses the following nonblocking nits from previous patches:

- Consolidate warning logs when disabling service due to exception when
  processing oslo.config ksa settings [1].
- Move a TODO out of a docstring [2].
- Remove a now-redundant region_name comparison in CloudRegion.__eq__
  [3].
- DRY the test_get_region_name unit test [4].

[1] https://review.opendev.org/#/c/663439/3/openstack/config/cloud_region.py@171
[2] https://review.opendev.org/#/c/662865/4/openstack/config/cloud_region.py@156
[3] https://review.opendev.org/#/c/662865/4/openstack/config/cloud_region.py@237
[4] https://review.opendev.org/#/c/662865/4/openstack/tests/unit/config/test_cloud_config.py@185

Change-Id: I1c140677347cf40db11e75f6a868356300d85071
2019-06-06 12:25:03 -05:00
Eric Fried
820790225c Handle oslo.config exceptions in from_conf
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
2019-06-06 12:25:00 -05:00
Zuul
5f536b6f7c Merge "Support skipping unknown QP" 2019-06-06 15:08:31 +00:00
Charlie
40cc2cc564 Support deleting all routes in update_router
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
2019-06-06 01:40:35 +10:00
Eric Fried
a5dfa85d4e Get rid of unused _OpenStackCloudMixin.get_region
This method was unused. Kill it.

Change-Id: I2bd7c178ce321e408b10968183f8740196aa6903
0.30.0
2019-06-04 09:05:07 -05:00
Eric Fried
5f0401a206 Support Proxy-specific region_name
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
2019-06-04 13:38:17 +00:00
Monty Taylor
86ad9debd1 Make factory for a CloudRegion from CONF objects
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
2019-06-04 08:36:23 -05:00
Artem Goncharov
1044776140 Use Resource layer for the compute Hypervsors and Images
- 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
2019-06-04 10:16:35 +00:00
Artem Goncharov
de03f4f53a Use Resource layer for compute AZ and Aggregates
Change-Id: I72a02ade12667a797643998f1ee9d07a6889f369
2019-06-03 13:44:41 +02:00
Artem Goncharov
38847204f9 Support skipping unknown QP
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
2019-06-03 09:45:29 +02:00
Logan V
9db14f6d78 Update Limestone Networks vendor config
- 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
0.29.0
2019-05-23 12:45:49 -05:00
Zuul
3bcaf2d5e0 Merge "Add ability to provide qos_policy_id for port" 2019-05-23 10:21:43 +00:00
Zuul
7a1c63513b Merge "Add support for vendor hooks" 2019-05-23 10:11:21 +00:00
Dmitry Tantsur
e4205085b3 baremetal: allow updating name and extra fields of an allocation
Support for this was introduced in Bare Metal API 1.57 (Train).

Change-Id: I4885d9a710cd6697c241bb1962dbbe2741a049a1
Story: #2005126
Task: #29798
2019-05-22 13:06:03 +02:00
Dmitriy Rabotjagov
ac7fbea1a4 Add ability to provide qos_policy_id for port
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
2019-05-22 14:02:02 +03:00
Zuul
4f276064a8 Merge "Adding dns_domain parameter into create_network" 2019-05-18 12:57:08 +00:00
Zuul
60c50f0c04 Merge "Add image.stage methods" 2019-05-17 17:28:23 +00:00
Raimund Hook
a3e846e2b9 Adding dns_domain parameter into create_network
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
2019-05-17 14:30:50 +01:00
zhangboye
5d949c7bf6 Cap sphinx for py2 to match global requirements
Change-Id: I1757faac7ba6993af3557a2e678ee0719395d134
2019-05-16 14:00:54 +08:00
Eric Fried
e47d2561e4 Link to baremetal API reference from patch_node
Add a link in the patch_node docstring to the corresponding baremetal
API operation, Update Node (PATCH /v1/nodes/{node_ident}).

Change-Id: Id13b1d148c7200ce78787181aa3f376372f21df6
2019-05-14 08:50:16 -05:00
Artem Goncharov
cc51e34cf1 Add image.stage methods
Add support for staging (and completing the import) image data.

Change-Id: Id865c7ffe5fff5d723074c22d0fd01d817ae932d
2019-05-14 06:49:06 +00:00
Artem Goncharov
75b0f292f8 Add support for vendor hooks
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
2019-05-13 20:15:07 +02:00
Artem Goncharov
51393509d1 Replace use of log.warn with log.warning
replace use of deprecated methods

Change-Id: I20dce5eb88306d8292baac9d803cbb6e8ac0402f
2019-05-11 09:45:03 +02:00
Artem Goncharov
cf9922e885 Extract image download method into a mixin
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
2019-05-11 09:40:38 +02:00
Artem Goncharov
1e810595c6 Continue refactoring of the image
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
0.28.0
2019-05-10 18:34:34 +02:00
Zuul
f0c56488cb Merge "Workaround older octavia version discovery" 2019-05-09 18:35:50 +00:00
Zuul
5434d91f66 Merge "Update baremetal to use proxy logger" 2019-05-09 18:30:03 +00:00