Commit Graph

96 Commits

Author SHA1 Message Date
Eyal 8bdf341af7 Remove OpenStack actions from mistral
Depends-on: https://review.opendev.org/#/c/703296/
Depends-On: https://review.opendev.org/#/c/704280/
Change-Id: Id62fdabe7699e7c3b2977166e253cfc77779e467
2020-02-26 10:12:01 +02:00
Eyal eaf0916e31 Fix fake clients in actions
* Use inspector_url when creating a fake client for ironic inspector client
* Add a session and a url for designate fake client

Change-Id: I9cc78df13d0f0715538bbdb76c8ccad273bd2033
2020-01-27 17:35:06 +02:00
Eyal 947a986a72 Gnocchi: fix client options
Based on https://review.opendev.org/#/c/488307/3

Change-Id: I367926727291f5f21b1849237ca29fdce7e926c0
Closes-Bug: 1707131
2020-01-19 14:26:26 +02:00
Dominic Schlegel f6ec559cac adjust doc string to correct key
Change-Id: I194d17b64a953ed0497da02b9ec079a536965668
2019-10-21 09:14:09 +02:00
Eyal b4a46fd1e6 Remove volumes.promote and volumes.reenable action from cinder
They were removed from cinder api see https://review.opendev.org/#/c/658318/
also move to cinder v3 (v2 is deprecated)

Change-Id: I35dd5927465152bb70822638bbaf7573db1220f1
2019-09-26 11:40:10 +03:00
Dmitry Tantsur 0de247948b Pass a real session to ironicclient in _get_fake_client
Using a dict is not guaranteed to work (and actually doesn't with
ironicclient 3.0.0, although a few other things are broken with it).

Change-Id: I59c113b22c60f04e89a631ade8039c4fa62933dc
2019-09-25 14:31:59 +02:00
Renat Akhmerov efc4cf078e Use v2 designate client instead of v1
* Module designateclient.v1 doesn't exist anymore after
  python-designateclient 3.0.0 is out. The new client
  requires a keystone session so all other parameters
  were dropped. Since this service now requires a
  a session the generator test now mocks the method
  _get_fake_client() for this action.
* Minor style changes.

Change-Id: Ida722828e3f1481e08f52257405ddfa2175733fa
2019-09-18 14:42:56 +07:00
Bo Tran 9585a63847 Fix don't work with senlin actions
We can't do run senlin actions because have an error when
init client senlin. We need an other way to init client to
run client with cron trigger and manual.

Change-Id: I294d18b341a3c7dd0df9c24588540f9c94dd4562
Closes-Bug: #1843178
2019-09-12 06:22:51 +00:00
Kien Nguyen 6dfab10e3d Support OpenStack services dynamic versions
Some OpenStack services have a discover_version method [1]
that returned a most recent version supported by API
and client. Mistral should use this method rather than
hardcode API version (manilaclient was done).

[1] https://github.com/openstack/python-novaclient/blob/master/novaclient/api_versions.py#L250

Change-Id: I0459206be5cc390853b9c69e8c5002568d1efa60
2019-09-03 01:25:34 +00:00
Brad P. Crochet b6ebcb3bd0 Use SessionClient for Ironic actions
The HTTPClient for Ironic is deprecated and will be removed in Stein.
Use the SessionClient for Ironic actions instead. Also uses
endpoint_override param instead of endpoint, as that is also
deprecated.

Change-Id: Ida3b502b25887ec9a7b51c4d6497699cc9466f05
2019-07-07 06:10:05 +00:00
Jose Castro Leon eb59216281 Removes insecure parameter from barbican client
This removes the parameter insecure in the client creation as this
no longer exists in the client. It also changes the client class
to be called as other clients in openstack using sessions

Change-Id: I3cb7ed4255f8996b8bfd9a3e1edba6de50f4e492
Closes-Bug: #1800819
2019-05-13 06:54:39 +00:00
Jose Castro Leon b7107c848f Adds secrets_retrieve to the list of available actions in barbican
This method allows to retrieve the payloads of secrets in the
workflows.

Change-Id: I7d391a6b46ddd4b388c11a69b75f2a2cd7e40384
Closes-Bug: #1800821
2019-05-03 17:42:24 +00:00
Thomas Herve ec3d14112c Fix senlin fake client creation
The new openstacksdk mechanism forces a keystone request to find info
about endpoints. We don't need this for fake client, so skip the
__init__ of the class.

Change-Id: I5b0d89ac57c14f982a6afa638f088d365e0e4ab8
2018-11-06 11:52:32 +01:00
Jose Castro Leon 6b4cc9a4a6 Removes non needed parameter passed in magnum client creation
Magnum client instantiation does not need the user_id parameter
coming from the context to do the operations.

Change-Id: I70070aee03671bf04ba4b933039b2c3fbf07c16f
Closes-Bug: #1786480
2018-08-10 15:59:26 +02:00
Zuul 952967a019 Merge "Remove hardcoded usage of v2 authentication in Barbican actions" 2018-08-03 11:03:26 +00:00
Jose Castro Leon a2756a34c2 Support Manila actions in Mistral
Adds manila actions into the available list of actions for mistral

Change-Id: Ic0a3c24f72d91a8a87ffcf81db763058bcbf8566
Closes-Bug: #1783291
2018-07-24 15:11:08 +02:00
Jose Castro Leon 36f28dec45 Remove hardcoded usage of v2 authentication in Barbican actions
There are still some hardcoded v2 authentication in barbican actions.
This api has been deprecated and removed, so we can change it to use
instead v3. It also removes the version number from some helper methods.

Change-Id: I0390daf841463d11cb7c61653897949989b6e6eb
Closes-bug: #1783316
2018-07-24 13:32:07 +02:00
Lingxian Kong 4fe4198ac8 Support Qinling actions in Mistral
An example can be found in the task description.

Remove the cap on networkx library according to:
13644d63c6 (diff-d7d5c6fa7118ea10d88f3afeaef4da77)

Depends-On: https://review.openstack.org/#/c/567971/
Change-Id: I168a32b8c73b4b30224ce8f27bcde9cfa2b8d2ad
Story: 2002014
Task: 19654
2018-05-16 21:27:42 +12:00
pengdake 11896ba733 Support actions for zun
Add ZunAction for zun. Zun is an OpenStack Container service. It aims to
provide an API service for running application containers without the
need to manage servers or clusters.

Change-Id: Ibbe4777528b5af6fdb3a6c2ed3345f8f9c804bef
Signed-off-by: pengdake <19921207pq@gmail.com>
2018-04-27 09:52:19 +08:00
pengdake 92b6016e3d Fix error about SenlinAction
The senlin action is not found after populating database.

Closes-Bug: 1756252

Change-Id: I7a80c8d8325d3c4446e6a0082a354552bc1adfa7
2018-04-25 19:25:05 +08:00
Jaewook Oh f25fb43177 Added Vitrage actions into Mistral
Implements: blueprint mistral-vitrage-actions

Change-Id: I11068c1f1a0d7ee6973e7c736ba92c475f7d0902
2018-04-24 22:41:04 +09:00
Dougal Matthews 1a65bc447e Add Swift Service OpenStack Actions
Implements: blueprint mistral-support-swift-service-methods
Change-Id: I41649d15c57e16bffcf7870a52bc01177aae7cc8
2018-04-10 09:27:19 +01:00
Honza Pokorny 78c78ce276 Add claim_messages and delete_messages zaqar actions
Change-Id: I8d979439ada3c646f50d4e878bb0a6ab6edeca69
Partial-Bug: 1733633
2018-01-30 15:16:03 -04:00
Pradeep Kilambi 16de7e004f Remove ceilometer actions from mistral
ceilometer api and client have been deprecated for over
two releases and now removed completely. Lets drop these
actions and update the requirements.

Change-Id: Ica2b835a885b9b4705996f91080afc12587bd314
2018-01-11 14:28:16 -05:00
Brad P. Crochet 43e453d8b6 Fix swift endpoint
The swift actions are not working. Need to pass the preauthurl to the
client with the actual swift endpoint.

Change-Id: I991f91c4dace8d82a7b3204b039c080b8399f63b
2017-12-06 11:39:29 -05:00
Brad P. Crochet f73fa541a0 Use a session for keystone auth
Update the following OpenStack clients to use sessions in their actions

Nova
Neutron
Keystone
Glance
Cinder
Heat

Also removes some extra code from Zaqar and Swift client creation.

Change-Id: Ifa24d914a0b3266eb3f18dcb2a26ce73902c55e3
2017-11-29 16:04:28 -05:00
Zuul c5fd23cda7 Merge "Stop passing auth_token to ironic-inspector-client" 2017-11-29 14:10:00 +00:00
Brad P. Crochet bec878eb89 Switch zaqarclient and swiftclient to use a session
Use a keystone session with zaqar and swift clients.

Change-Id: I1be34d903b2785205c1f240095e52a63de795b8e
Closes-Bug: #1733345
2017-11-21 12:33:35 -05:00
Dmitry Tantsur 76eba6cc2a Stop passing auth_token to ironic-inspector-client
This has been deprecated long ago, and will be removed really soon.
Create a Token authentication, build a Session and pass it instead.
This reflects how a session was created with auth_token inside the
client previously.

Change-Id: I3ce2916872b6ba4c36d4d6f294456454eee78314
2017-11-20 12:07:06 +01:00
Bob.Haddleton 91ce8986f2 Allow mistral actions to run when authentication is not configured.
Use the configured API host and port for the mistal URL, which defaults
to 0.0.0.0 and 8989,

Change-Id: I154b3dc174a9c40887729bb3f8866d5c2316cd12
Closes-Bug: 1709677
2017-10-06 03:44:39 +00:00
Dougal Matthews 9e5d57dadb Add actions for the ironic virtual network interface commands
To do this we need to update the Ironic API version to the latest stable
release.

Change-Id: I60101883db26f679aa833e8b5638225d9fb93761
2017-10-05 14:29:29 +00:00
Mike Fedosin fec851381d Add Glare action pack
This patch adds Glare action pack into Mistral.

Change-Id: Icf4ce5a37f555d01cf9c0b865a6816e3f6801f3a
Implements-blueprint: glare-action-pack
2017-07-31 15:08:22 +00:00
Sharat Sharma b38dceec50 Add a hacking rule for string interpolation at logging
From [1], string interpolation should be delayed to be handled by
the logging code, rather than being done at the point of the logging
call. Add a hacking rule, [M331], to delay the string interpolation.

[1] https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages
Change-Id: Ibf0ac960ae84e935979f93f3a0dec8d774aade78
Closes-Bug: #1705634
2017-07-26 11:13:15 +00:00
Andras Kovi f2c8e0c2a1 Centralize session creation and authorization from OS clients
Recently novaclient moved to keystoneauth. When a token is passed to it,
an instance of Token auth plugin is used to handle it. The problem is
that it tries to reauthenticate using the token. It is not possible
with trust-scoped token.

Here we centralize the session establishment for service client creation
in most actions that enables the reuse of the existing token.

Change-Id: Ibe9ee28a027e7a782adb8d8120d745259c4608da
Co-Authored-By: Andras Kovi <akovi@nokia.com>
Closes-Bug: 1690787
2017-06-27 13:18:12 +02:00
Thomas Herve bb9d8544d7 Always retrieve endpoint in mistral action
The mistral action had a strange conditional where it would only
retrieve the endpoint when trust tokens are used, and otherwise rely on
the client to do so. It seems to make more sense to do it all the time,
especially for services which uses trust tokens to talk to Mistral (eg
Heat).

Change-Id: If37162f7df59978dc511d0e920e952fb954ba10f
2017-06-09 15:35:59 +02:00
Adriano Petrich a4fa5ba0f9 Adding mistral_lib actions to mistral
This deprecates the mistral.actions.base:Action in favor of
mistral_lib.actions:Action

Change-Id: I3dedb6474922c341088a12696f3f5c418594847b
2017-05-17 17:59:38 +01:00
Lingxian Kong 8b6147d076 Add "action_region" param for OpenStack actions
A new config item 'modules-support-region' is introduced to be used by
cloud operators, mistral will decide if add 'action_region' param to
openstack service action inputs according to that config.

Fixed an action definition for tempest tests.

TODO: Add release note.

Implements: blueprint mistral-multi-region-support

Change-Id: I0b582e9f81ab72cd05f4fae592c568f38dec6e00
2017-05-16 14:06:56 +12:00
Winson Chan bc18ecbe24 Fix try import of openstack client modules
The import of python-muranoclient is causing mistral-db-manage populate
to fail. This patch fixes the try import to log and print to stdout the
modules that fail and allow other imports to continue.

Change-Id: Ied643a6173f40141fea59e5ab6e0df26b53d33f5
Partial-Bug: #1659663
2017-02-02 05:22:37 +00:00
Dougal Matthews 76f20ee437 Remove insecure flag from the Baremetal Introspection client
The baremetal inspector client does not take the "insecure" argument. It
was incorrectly added in 600dd47654.

This is currently breaking TripleO.

Closes-Bug: #1656692
Change-Id: Ic1f55e9a243302d4d2715654b4d9d4abe5000d2a
2017-01-16 07:50:36 +00:00
Istvan Imre 600dd47654 Insecure flag added to openstack context
New Insecure flag inroduced for openstack actions. With that mistral
is able to connect to https clouds without verifying server certificate.

Change-Id: If7839ac586ff0b50f3f323a6bd42349eb0c25ca8
2017-01-12 08:18:16 +00:00
fengchaoyang 6d9b53ef3d Added gnocchi action pack
This patch adds gnocchi action pack into mistral.

Change-Id: I1438b554356ad8ea6b86744eea1402e1f5526739
Depends-On: I99915d9ad5d1ccfa7ff326adab89937cf64a07ce
Implements: blueprint mistral-gnocchi-actions
2017-01-03 12:27:38 +08:00
Pradeep Kilambi 44768730a7 Add aodh actions to mistral
Depends-on: I52df197c0e22f0814f7339601a7291fc057463f8

Implements: blueprint aodh-action-pack

Change-Id: I30d0a2e87ec97a49d81ada4f2ee34c7934935ab3
2016-12-22 11:12:22 +00:00
Dmitry Tantsur 57e4614c16 Bump Ironic API version to 1.22 when creating the Ironic client
Due to how microversioning works in the Ironic client, it is not possible
to use API features introduced in API version 1.10 and later from Mistral,
as the default version is 1.9 (mid-Liberty). This change bumps the required
API version to 1.22 (Newton final).

See the following link for the full API version history:
http://docs.openstack.org/developer/ironic/dev/webapi-version-history.html

Change-Id: I1c605fc00efe5fe8956d6547ea5e85e6e1172c9b
2016-11-30 15:23:27 +01:00
Sharat Sharma 84f3c1fb9d Added senlin action pack
This patch adds senlin action pack into mistral

Change-Id: Ic822bfd3f43e6f6e834dd26bb87387d1eef93a89
Implements-Blueprint: senlin-action-pack
2016-11-14 09:21:09 +00:00
Jeff Peeler 347aabc1e5 Add client caching for OpenStack actions
This change adds caching for all the actions. When an action request
is made, the cache is checked to see if a client has already been
created. If an existing client is found, the keystone token expiration
is verified to still be current within the configurable window. Once a
client's token becomes invalid a new client is created and the cache
is refreshed.

The new configuration option for setting the token expiration window
is expiration_token_duration present in the default section.

Change-Id: I854f0251d9ec3623700d8a4025df8f1bc632a3e9
2016-08-29 17:47:50 -04:00
Juan Antonio Osorio Robles 81f16827e3 Use actual session for ironic-inspector action population
python-ironic-inspector needs an actual session when creating the
client, since it will try to fetch and furtherly validate the given
version regardless if a version is explicitly given. This fetching
and validation do calls to keystone which require credentials. Thus,
I'm using mistral's service credentials to fetch the required info.

Change-Id: I908552d2fb8ab4a5a3593f03f92ee6a31b672034
2016-08-05 08:13:55 +03:00
Juan Antonio Osorio Robles b8c0ba864c Add _get_fake_client to ironic-inspector actions
When populating the ironic-inspector actions, the client code tries
to get a proper version (since none was given). And thus, in that
code it may fail if inspector is not listening on localhost (which is
what it tries to access by default). By setting the version in the
_get_fake_client call, we avoid this call.

Change-Id: I34d4739392a0d7c2967c1bc4ebf24d7ff5a56ab3
2016-08-02 17:28:37 +03:00
Jenkins 164a504dec Merge "Add configuration option for endpoint type" 2016-07-08 09:01:31 +00:00
Jenkins 5a61d17785 Merge "Fix Magnum action _get_fake_class" 2016-07-08 06:16:22 +00:00
Jenkins 2f5f705497 Merge "Fix Murano action _get_fake_class" 2016-07-08 05:32:52 +00:00