32 Commits

Author SHA1 Message Date
Thomas Herve
5935afe40c Catch websocket connection close errors in cleanup
This can add useless noise when we have timeouts in particular.

Change-Id: I55d18885f06e530ff9a5492c0b98f37525e88ed6
Closes-Bug: #1805647
2018-11-28 18:19:52 +01:00
Zuul
603db8cd2e Merge "Handle tls endpoint for zaqar websocket client" 2018-10-20 12:20:28 +00:00
Quique Llorente
fee9f8cf15 Raise proper exception at webscocket close
After fixing a bug with https://review.openstack.org/#/c/603802/ the
return introduced there is bogus, we have to raise a proper exception
and handle it like timeouts, to get all the mistral allright.

Change-Id: Idcdbd38129f5694c5452f3f8aca0388df80476b2
2018-09-26 13:58:04 +02:00
Zuul
7d5d19aed6 Merge "Add a guard to break if no connection" 2018-09-21 16:45:59 +00:00
Quique Llorente
99b7a3d1d1 Add a guard to break if no connection
If the WebSocket connection is already disconnected we don't have to
wait for messages

Change-Id: I7543c8e61711f036140db20416a57447da6c4c18
Closes-Bug: #1793264
2018-09-19 15:46:11 +02:00
Jill Rouleau
6639b9e564 Handle tls endpoint for zaqar websocket client
When creating zaqar websocket client, if the endpoint has tls enabled
provide the CA to the client.

Closes-Bug: 1791970
Change-Id: I09fca4ea80ae8246f136ea6998dfc7ad1c6bb4d2
2018-09-11 13:38:54 -06:00
Dougal Matthews
658abc2bb8 Debug log the raw Zaqar message
Currently we have no record of this, it would be useful to include it
when --debug is used on a CLI command.

Closes-Bug: #1776874
Change-Id: Iec3267423594db838a5c8c0624aaae23aab0f488
2018-06-14 10:55:25 +01:00
Dougal Matthews
99520c98b8 Don't delete the tripleo Zaqar queue
Now that we share a queue with other commands and other clients (the GUI
at least) we should never delete the queue.

Closes-Bug: #1757984
Change-Id: I1555b5e43984dea941885f221c4ec46092a34735
2018-03-23 14:56:06 +00:00
Mathieu Bultel
b3fae6ee1a Pass the queue_name to messaging_websocket function for update
For update and upgrade, we need to pass a different queue name
to the websocket in order to read the ansible runtime
This review allow to pass another queue than the tripleo default
one

Change-Id: I7166093cf1a26969425b33f4442f45fa8dc707f0
2018-02-14 13:54:34 +01:00
Zuul
bc26600501 Merge "Tripleoclient unified queue name." 2017-11-08 05:15:23 +00:00
Toure Dunnon
1bd1620ead Tripleoclient unified queue name.
This will allow the cli and tripleo UI to share a common queue,
which will help with scripting the frontend behaviour or track
the progress of the cli from the frontend.

Related-Bug: #1603345

Change-Id: I5849983eee82b5a56cae1bf38a3c2694b6b291db
2017-11-06 13:46:14 -05:00
Ian Main
1c3b4540ec Refactor undercloud deploy to use Ansible.
This patch refactors undercloud deploy:
- Cleans up the ordering so that you can plainly see what is happening.
- Calls heat to resolve the stack without actually doing anything.
- Downloads Ansible from resolved heat stack.
- Calls ansible directly with exec().
- Cleans up error handling to be very clear in the case of any errors
  from the script or from heat.
- Kills heat silently and reliably.
- Removes fake keystone.
- Removes any yum updates.

Co-Authored-By: Dan Prince <dprince@redhat.com>

Depends-On: I03f1789957ba157871fd13164592116d7fcdabe4
Depends-On: I5413ae4eadd5affdd1ae01678b61eafbe50b7919
Change-Id: I9fce6477566b439ceb2b5dc25eae307af9c9cc2b
2017-11-06 16:19:17 +00:00
Dougal Matthews
70998137f6 Remove the single-message interface to websockets
This is longer used and the multiple-message interface should be used.

Change-Id: I84a2d593ae3bad2559de530de8678925a2109547
Closes-Bug: #1646887
2017-04-04 09:14:26 +01:00
Dougal Matthews
0747748743 Handle multiple messages from workflow executions
Currently, tripleoclient will ignore messages from workflows if they
don't match the execution ID of the worflow it starts. This can happen
if the workflow starts sub-workflows, which run under their own
execution ID. tripleoclient will also stop listening for messages after
it recieves the first message from the workflow it started. Meaning, it
assumes the workflow to send one, and only one, message.

This change tackles the first limitation, by turning the message
consumption into a generator which yields each message one at a time.
It then starts a convention of assuming the workflow has finished if it
recieves a message with the top level execution ID and it contains a
status that isn't "RUNNING". For example: {"status": "SUCCESS"}.

Partial-Bug: #1646887
Change-Id: Ida07718b4fab41e0a6088f2db8f9b42b6fb09f72
2017-03-16 10:17:56 +00:00
Dan Prince
5f58088ff5 Deploy the undercloud with Heat
This patch adds a new 'undercloud deploy' option which:

 -installs and configures os-collect-config, and hooks using instack

 -forks an all-in-one heat-api/engine process using noauth

 -spawn our own fake keystone thread for noauth Heat

 -creates a Heat stack for the undercloud using t-h-t

 -starts os-collect-config to drive the deployment of Heat
  metadata

Partially-implements: blueprint heat-undercloud

Depends-On: I50a8cc46b4c3c235d438a711760fba94bf8e9715
Depends-On: I36df7fa86c2ff40026d59f02248af529a4a81861

Co-Authored-By: Ian Main <imain@redhat.com>
Co-Authored-by: Flavio Percoco <flaper87@gmail.com>
Change-Id: Ib05062e3710aeec922988d5f1308be44b5468473
2017-02-14 17:01:33 +01:00
Dougal Matthews
579d1b1318 Add an optional timeout when waiting for websocket messages
This patch adds a mechanism for setting a timeout when waiting for websocket
messages. It then adds it to workflow executions which are fairly predictable.
This means that they always take roughly the same length of time. Other
workflows like baremetal introspection can be much slower or quicker
depending on the the users environment.

Closes-Bug: #1618445
Change-Id: I656735d58b1b676148e6ceacfc9861b3c5f44e5d
2016-11-28 12:56:56 +00:00
Jenkins
e30d05a8ac Merge "Display error message when socket is closed" 2016-09-21 21:47:55 +00:00
Dougal Matthews
133e8cf91a Migrate to using osc-lib
This new library provides the common logic used by openstack
clients. Replacing the imports from openstackclient and cliff.

Depends-On-External: https://review.rdoproject.org/r/#/c/2088/
Depends-On: I095209c241876c6ab48595962e07144fc5cc34a6
Closes-Bug: #1620964
Change-Id: I103a13ff6c0af94b82f5e48652380adfbf331d34
2016-09-13 22:35:01 +00:00
Julie Pichon
12932b0cac Display error message when socket is closed
Give the user some additional information when Zaqar is down. Also,
move the websocket import to the third-party import list.

Change-Id: I8d4caf2ba08bceba1f014555ccd6ae3ca1a4a6c0
Closes-Bug: #1619712
2016-09-12 13:05:41 +01:00
Dougal Matthews
2c0fecf69c Add 'openstack overcloud plan create' command
This uses the new Mistral actions and workflows to create a
plan with the tripleo heat templates. Templates can either
be provided by the user or the default templates on the
undercloud can be used.

Closes-Bug: #1616014
Change-Id: I4f82fda01215b9a45669862ef26c69421fdaad59
2016-09-01 14:13:16 +01:00
Dan Prince
32ef667cbf Use the messaging-websocket endpoint
We now have a separate endpoint specifically for Zaqar websocket
support so lets use it.

Change-Id: I4c6ee4623205402bf7419f95f22bbf03f18f0ddb
2016-08-06 15:03:13 -04:00
Brad P. Crochet
4f10fe4080 Remove another private OSC attribute usage
tripleoclient WebsocketClient used a private auth attribute. This
switches it to a more public api.

Change-Id: Ib6a3ad21b9d770dad943b6e567cfbea8402cc84f
Closes-Bug: #1605876
2016-07-29 09:10:27 -04:00
Dougal Matthews
5942105e2e Don't cache and re-use the websocket
The socket is bound to the queue name and this this removes the
ability to work with multiple queues and if the websocket it
closed it can't be easily recreated.

Change-Id: I6d05b9536111a77a54b818dcf1a9d030ad464e7f
2016-07-01 10:23:47 +01:00
Dan Prince
2f652b44ca Add a method to wait for messages on the websocket
This also adds the ability to use the websocket client as a
context manager which simplifies the requirement of calling
cleanup.

Co-Authored-By: Dougal Matthews <dougal@redhat.com>
Change-Id: I80ce73a4fdf6d1f12495960f2c4bf460f1875e4e
2016-06-28 20:50:22 +01:00
Dan Prince
a97dc6b158 Add support for Zaqar websocket messaging
Updates the plugin ClientManager so that we support creating
a websocket authenticated with Zaqar so that actions can
interact with Zaqar queues.

Co-Authored-By: Thomas Herve <therve@redhat.com>
Co-Authored-By: Dougal Matthews <dougal@redhat.com>

Depends on external: https://review.rdoproject.org/r/#/c/1289
Partially-implements: blueprint remote-execution
Change-Id: Idf522b3d4193776a5b6626cef28336820257d4e7
2016-06-09 15:17:12 +01:00
Brad P. Crochet
cdcf16ee45 Remove the orchestration property from tripleoclient class
Use the OSC-compatible orchestration client instead of the home-grown
one. This reduces duplicate code, and relies on more thoroughly tested
code elsewhere.

Change-Id: Ib77d20086f86a260197c6f289fd9c270b766544c
Depends-On: I7aa0fd7c152ee91b6e2b956f7e594f8c8aacafa7
2016-05-17 08:07:57 -04:00
Miles Gould
000f67a4c7 Remove tripleoclient.baremetal wrapper
The Ironic client now supports the OSC plugin interface directly, so
this wrapper is no longer needed. Removing it will allow us to specify
which Ironic API version to use via the standard mechanisms.

Change-Id: If92855c307ecd389fbe6050e426d0ced959a9665
Depends-On: Icdbd28c487351af6d67205837aa536aedb31b41a
2016-02-09 12:36:19 +00:00
Brad P. Crochet
f3af5c5c1c Turn the baremetal client reference into a property
Use a property instead of a function. This is more in line with how the
clients are referenced with openstackclient, thereby making it easier
to switch to the Ironic OSC plugin in the future.

Change-Id: I0b4d35f0af6136dd1bce6c6d4202caa52f4c042e
2015-10-27 12:31:54 +00:00
Brad P. Crochet
90bf132049 Turn the orchestration client reference into a property
Use a property instead of a function. This is more in line with how the
clients are referenced with openstackclient, thereby making it easier
to switch to the a Heat OSC plugin in the future.

Change-Id: I849593e6328f3883235e9ae34232f92d6b3c0d80
2015-10-13 10:53:03 +00:00
Dougal Matthews
6abf557aa1 Remove Tuskar support
This change removes Tuskar support from the following commands:

    - openstack overcloud deploy
    - openstack overcloud node delete
    - openstack overcloud update stack

This removal is due to the limiting nature of Tuskar, we can achieve everything
we need and more without it. The change also removes python-tuskarclient from
the requirements and if the Tuskar CLI (openstack management commands) is
required it will need to be installed independently.

This change is dependant on the Tuskar examples being removed from the
documentation. These are removed in the dependant change ID below.

Depends-On: I2d4aa114156c5bafb003e6a67862ed6d1449fd98
Change-Id: Ic6fd4568054fe91b8fc898728022a7d7ed8cf3cf
2015-09-28 07:50:48 +00:00
Brad P. Crochet
1823b837cd Cleanup some strangling references to rdomanager-oscplugin
Change-Id: I46e3e0b6c4028789676428eaaa1e4c558346ecf4
2015-09-17 15:54:14 +00:00
Brad P. Crochet
12edde8a53 Rename rdomanager_oscplugin to tripleoclient
Change-Id: I4593a5248160204645d567d7f2fa3a396629082b
2015-09-08 10:22:22 -04:00