Commit Graph

37 Commits (2f9215b2535a976e1d1568650aa78be3fe8b5606)

Author SHA1 Message Date
Dougal Matthews 41b51731ba Raise a new ValueError with the contents of the JSON is parsing fails
Change-Id: I52c728fb9fae9ec955caf8a63adb00ee708d9419
3 years ago
Kevin Carter 5855d41262 Extend the mistral context class
This change extends our mistral context class to ensure that we're passing everything that
tripleo-common will expect, which includes deprecated objects.

Change-Id: I9dae28d597be0d11acaa35026f5316db4d6d8ae1
Signed-off-by: Kevin Carter <>
3 years ago
Dougal Matthews 0d92dc15f8 Remove Mistral from plan list and call the Mistral action directly
This change creates a context that mimics the Mistral context. This
allows us to short-circuit and cut Mistral out, calling the Python
action directly.

All plan list actions have been updated to use this new process and
the old mistral function has been deleted.

Story: 2007247
Task: 38594

Change-Id: I463b5e3d1c4c15dd859a841d65a5057716f84208
3 years ago
Dougal Matthews f456ac9312 Prepare tripleoclient for v2 implementations of the commands
This change creates the v2 directories for the new versions of the CLI
commands that use Ansible.

Change-Id: Ic8d9a77a5f75046c1417d195a2e52d3e9c9de796
3 years ago
Juan Antonio Osorio Robles 24ac1f137c Use OS_CACERT for zaqar's websocket connection
The CA certificatge was hardcoded. This was not the right thing to do,
since we do have the ability to provide our own cert for TripleO.

python-openstackclient already has a way for us to know what certificate
was used. This is provided via the OS_CACERT environment variable (or
the --os-cacert command line argument). So we use this instead.

Change-Id: Ib7b3860378fce2cda7f80c1ad8b8dd14a4b22581
Closes-Bug: #1817634
4 years ago
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
5 years ago
Zuul 603db8cd2e Merge "Handle tls endpoint for zaqar websocket client" 5 years ago
Quique Llorente fee9f8cf15 Raise proper exception at webscocket close
After fixing a bug with 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
5 years ago
Zuul 7d5d19aed6 Merge "Add a guard to break if no connection" 5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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

Change-Id: I7166093cf1a26969425b33f4442f45fa8dc707f0
5 years ago
Zuul bc26600501 Merge "Tripleoclient unified queue name." 6 years ago
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
6 years ago
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 <>

Depends-On: I03f1789957ba157871fd13164592116d7fcdabe4
Depends-On: I5413ae4eadd5affdd1ae01678b61eafbe50b7919
Change-Id: I9fce6477566b439ceb2b5dc25eae307af9c9cc2b
6 years ago
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
6 years ago
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
6 years ago
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

Partially-implements: blueprint heat-undercloud

Depends-On: I50a8cc46b4c3c235d438a711760fba94bf8e9715
Depends-On: I36df7fa86c2ff40026d59f02248af529a4a81861

Co-Authored-By: Ian Main <>
Co-Authored-by: Flavio Percoco <>
Change-Id: Ib05062e3710aeec922988d5f1308be44b5468473
6 years ago
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
7 years ago
Jenkins e30d05a8ac Merge "Display error message when socket is closed" 7 years ago
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: I095209c241876c6ab48595962e07144fc5cc34a6
Closes-Bug: #1620964
Change-Id: I103a13ff6c0af94b82f5e48652380adfbf331d34
7 years ago
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
7 years ago
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
7 years ago
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
7 years ago
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
7 years ago
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
7 years ago
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

Co-Authored-By: Dougal Matthews <>
Change-Id: I80ce73a4fdf6d1f12495960f2c4bf460f1875e4e
7 years ago
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 <>
Co-Authored-By: Dougal Matthews <>

Depends on external:
Partially-implements: blueprint remote-execution
Change-Id: Idf522b3d4193776a5b6626cef28336820257d4e7
7 years ago
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
7 years ago
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
7 years ago
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
8 years ago
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
8 years ago
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
8 years ago
Brad P. Crochet 1823b837cd Cleanup some strangling references to rdomanager-oscplugin
Change-Id: I46e3e0b6c4028789676428eaaa1e4c558346ecf4
8 years ago
Brad P. Crochet 12edde8a53 Rename rdomanager_oscplugin to tripleoclient
Change-Id: I4593a5248160204645d567d7f2fa3a396629082b
8 years ago