Commit Graph

736 Commits

Author SHA1 Message Date
Tyler Adams 4e1b91f81a adding test for import_versioned_module
Change-Id: Ib49cbba926abc5b27778fa2aff0ed813ca866200
2024-03-10 01:17:42 +00:00
Zuul 9e21cdfd1a Merge "Fix config and metadata in cluster update" 2021-07-28 13:16:51 +00:00
Duc Truong 59ccfb17ba Fix config and metadata in cluster update
The config or metadata in cluster update should only be sent if the
values is not None.  Sending empty dictionary will override any existing
config or metadata setting.

Change-Id: Id23e743d1db30a0549d06081e87249a0dbd326a2
2020-11-17 19:51:32 +00:00
Duc Truong 901bf963c6 Adds --wait argument for cluster CLI interactions
Add option to wait for CLI command to complete for the following cluster
commands: create, update, delete, resize, scale in, scale out, policy
attach, policy detach, node add, node delete, node replace, cluster
check, recover and cluster operation.

Change-Id: I5663ca7286c55da4491644f979d5ab44f0cfc915
2020-11-13 22:07:48 +00:00
Duc Truong 74ece12e32 Send config parameters in cluster update
This patch set fixes a bug where config parameter was not send correctly
as part of cluster update.

Change-Id: I38d4a56a55cbb870c2afe1fa9de7564b5748dfba
Closes-Bug: #1896260
2020-09-23 16:39:44 +00:00
Luigi Toscano 921b70fcd6 Native Zuul v3 port of the legacy functional job
The name of the job now follows the guidelines.
Remove the old scripts which are not needed anymore.

Also, even though OS_TENANT_NAME is still exported,
read OS_PROJECT_NAME as first choice.

Depends-On: https://review.opendev.org/746235
Change-Id: I2d698e4f7c38e010cfef2961446914fff136b181
2020-08-23 00:48:11 +02:00
Hervé Beraud 9b80fd387f Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I8d02f93eef73af901b6d423e34806e28588d46f4
2020-06-02 20:51:52 +02:00
jacky06 f23d3ae5e4 Remove all usage of six library
Convert all code to not require six library and instead
use python 3.x logic.

Change-Id: I9301046d6df0bcdcc76808f8a32a67388ddffb95
2020-05-06 23:52:39 +08:00
Sean McGinnis 85f1e46944
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: If70feb43be0b12c582bc4a9f27faa8f83de93774
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:59:18 -05:00
Duc Truong d9430360be Flush confirmation messages
Confirmation messages for cluster, profile, policy, receiver and node
deletions are printed using sys.stdout.write.  However sys.stdout.write
output is line-buffered [1].  Since the confirmation message does not
contain a newline, the message may not appear in the user's terminal.

[1] https://docs.python.org/3/library/sys.html#sys.stdout

Change-Id: I829811df362bcfd7d074523958d2aa5232da6f09
Closes-Bug: 1861042
2020-01-27 23:15:31 +00:00
Bo Tran be73aeed39 Change default API version to 1.14
Depends-On: https://review.opendev.org/699650
Change-Id: I6c7cbf884317313f217538b6916b63770ea3a337
2019-12-18 17:24:43 +07:00
Zuul 852a0f4cc6 Merge "Add action update command" 2019-11-15 18:51:51 +00:00
Duc Truong e414a43951 Add action update command
Add support for action update API [1]

[1] https://docs.openstack.org/api-ref/clustering/#update-action

Change-Id: Ie6089c5de6c7e76380003080ac79db18ac1127e0
Depends-On: https://review.opendev.org/#/c/682787/
2019-11-15 17:19:54 +00:00
Duc Truong 4c39914798 Add support for node tainted field
- Update supported microversion to 1.13
- Return node tainted field
- Support setting tainted field for node update

Depends-On: https://review.opendev.org/#/c/690755/
Change-Id: I1b36e6e9b8f743308d4a8361ad1f6564a462f4f3
2019-10-24 16:35:37 +00:00
Duc Truong f6453b4f0f Return meta-data field for events list
Retrieve meta-data field for events from openstacksdk

Depends-On: https://review.opendev.org/#/c/678585/
Change-Id: Ib47ba849a9503122727eddd9f548684131417676
2019-08-26 16:49:42 -07:00
Andreas Jaeger db67679d59 Update api-ref location
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.

Note that redirects will be set up as well but let's point now to the
new location.

For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html

Change-Id: I59ae41adc16f3a05f29fcca1b1ba18b75be4df10
2019-07-22 21:03:24 +02:00
jonnary 84beed0efc Fix uint test test_json_format and Solve pep8 msgfmt error
For json format we only need check the json result.

For pep8 error:
xargs: msgfmt: No such file or directory
ERROR: InvocationError for command /bin/bash -c 'find senlinclient..'
http://logs.openstack.org/92/666992/2/gate/openstack-tox-pep8/fdbc082/job-output.txt.gz

We need to add bindep.txt, like neutron:
https://github.com/openstack/neutron/blob/master/bindep.txt#L5

Co-Authored-By: chenker <chen.ke14@zte.com.cn>

Change-Id: Ifb2d2bb3a1043ab1a4c94d30029bb920b4627a31
2019-06-29 12:27:35 +08:00
Zuul 5f9c27da4f Merge "Update json module to jsonutils" 2019-03-07 07:37:27 +00:00
Duc Truong 7a45be1273 Use latest senlin microversion for Stein
Change-Id: Ic546639fb1916a72b7ac03a47c01758fee777be0
2019-03-06 22:20:23 -08:00
Zuul 6ec11214e9 Merge "Update client to account for 409 error in cluster actions" 2019-03-05 20:28:49 +00:00
cao.yuan 3425b56057 Update json module to jsonutils
oslo project provide jsonutils, and senlinclient use it in many place[1],
this PS to update the remained json module to oslo jsonutils for
consistency.

[1]: https://github.com/openstack/python-senlinclient/search?q=jsonutils&unscoped_q=jsonutils

Change-Id: I08efcf3ca8382eab89db4da22821799faf32af59
2019-03-02 02:08:22 +08:00
Duc Truong 380ebb797a Fix getting action id in Location header
openstacksdk was changed to return action object with id inside for API
calls that have location in response header.

This change retrieves the action id from the action object returned when
calling cluster delete and node delete.

Depends-On: https://review.openstack.org/#/c/631362/
Change-Id: Ife9d3be5acd740f6de7721ba54aa87d44f924728
Closes-Bug: #1814171
2019-01-31 22:09:37 +00:00
Duc Truong d17c58228d Fix calls to functions removed from openstacksdk
Several clustering functions were deprecated in openstacksdk.  This
patch removes calls to those functions and replaces them with calls to
the renamed functions in openstacksdk.

Closes-Bug: 1802417
Change-Id: I799f7234a19d31def05f8bf5b778dcec31c59a7d
2018-12-18 17:54:18 +00:00
Thomas Herve 1df4982c7e Fix _get_config_from_profile key building
I7bc0bfdecf1b1461714de1da8b56e3e47154726d tried to introduce some method
to reuse profiles, but the key building was backwards.

Change-Id: I36bd0492be98b60594a742cd6ff316fa83e58d54
2018-10-30 14:35:52 +01:00
Yuanbin.Chen c04fc6ce0e Enable cluster profile only and replace function test
OpenStackSdk project was support api microversion.
and senlinclient was change sdk connection.
https://review.openstack.org/#/c/587411/

Change-Id: I15ad5caf7ca257b5f14a3a3204be11993cba1973
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-09-03 10:02:11 +08:00
Monty Taylor cda86480a4
Update python-senlinclient to use current openstacksdk
senlinclient still uses Profile, which is deprecated and marked for
removal. Update create_connection to be able to work in a post-Profile
world. Amongst other things, this was causing nothing to set the
default_microversion setting.

Also, make_client was calling create_connection, but it doesn't need to
because openstackclient already has an sdk_connection object that can be
used. Just return it.

Related to https://storyboard.openstack.org/#!/story/2003146

Change-Id: I7bc0bfdecf1b1461714de1da8b56e3e47154726d
2018-08-14 13:36:44 -05:00
Zuul 88e483b4ed Merge "Add cluster and receiver function test" 2018-07-31 12:47:19 +00:00
Yuanbin.Chen b6107826f4 Add cluster and receiver function test
- cluster function test
- policy attach/detach function test
- receiver function test

Add api microversion openstacksdk bug report link:
https://storyboard.openstack.org/#!/story/2003146

Change-Id: Ibe30c1402c80061a60b9499681fe00771d72ab0e
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-07-31 13:52:09 +08:00
Jude Cross 87b7b13ea9 Update client to account for 409 error in cluster actions
This patch allows the senlin client to properly parse a 409
error when a scaling action fails due to a conflict or cooldown

Depends-On: https://review.openstack.org/585573
Change-Id: I2fff7c2cc1bb17c0e32ef5b67294b811aff22192
2018-07-25 14:58:43 -07:00
Yuanbin.Chen b0d56b7a7f Change CURRENT_API_VERSION to "1.10"
senlin api was support max_version 1.10
https://github.com/openstack/senlin/blob/master/senlin/api/openstack/history.rst

Change-Id: I48309f053f54855c3121346993ab2129935513fd
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-07-13 00:28:42 +08:00
Yuanbin.Chen 62eba7e9bc Fix request return resp not exist 'action' key
This patch fix API version control requests failed,
print message error. The request cannot succeed when
the version of the request API operation has a special
request. Look:
https://github.com/openstack/senlin/blob/master/senlin/
api/openstack/v1/clusters.py#L123

And fix ResizeCluster max-complexity limit error.

Change-Id: Ieb474ee576e838843b8c03a692d7c09e594975b6
Closes-Bug: #1753747
2018-03-06 21:07:08 +08:00
Zuul 9601709d9f Merge "Remove unnecessary definition" 2018-03-01 12:09:41 +00:00
Zuul e303a2ec5f Merge "Add node functional test and fix type list test" 2018-03-01 10:33:46 +00:00
Yuanbin.Chen 5be4c7d3a6 Add node functional test and fix type list test
- Add node functional test
- Fix profile and policy list error

Change-Id: I1f247493dc119788e5a45008f4a70b7758fe927c
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-03-01 10:15:48 +00:00
OpenStack Proposal Bot 364bbc767c Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I76015e4ccd5e39228f511f819839177f2d490cc7
2018-03-01 06:25:51 +00:00
Zuul 0497baa83d Merge "Fix request version returns value handling error." 2018-02-23 08:33:17 +00:00
Zuul 7f561b178d Merge "Retrieve profile type by type name and version" 2018-02-23 01:29:49 +00:00
Yuanbin.Chen 842c1c3c01 Fix request version returns value handling error.
The request version is processed in the senlin code, so there are
different return values. The senlinclient should do different things.

Change-Id: I1091377e18e5e57d6c605d42ec40bd5b75625a3b
Closes-Bug: #1750964
2018-02-22 17:55:06 +08:00
blkart 977bebb5e6 Retrieve profile type by type name and version
Change-Id: Ia6e288c797516e3ccb3e2f33f432a3eb0f0e523f
Signed-off-by: blkart <blkart.org@gmail.com>
2018-02-12 13:31:01 +08:00
Yuanbin.Chen b6b4601a92 Change event and node module describe error.
Change-Id: I52c233690cf3408108dc4decd6eff66eb7fc3f17
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-02-12 13:03:01 +08:00
OpenStack Proposal Bot 0303d6899f Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I52306285ebae5d9cc5b94759d0afef5e820d7a93
2018-02-10 07:13:41 +00:00
Yuanbin.Chen 56c577c999 Add profile, policy functional test
- base module add output result format
- base module add access to the profile/policy file path
- base module add profile/policy create/delete call
- profile/policy module add create/update/delete tests

Change-Id: Iba3895a4ed8ed02cda68571457dad135f73ee33e
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-02-05 12:55:16 +08:00
pengdake 6b4fe5462b Remove unnecessary definition
Change-Id: Ia2f76e15a4b0226a5b62fe09ddcd0ff4e6fe0736
2018-02-03 20:16:56 +08:00
Zuul 469940c9b9 Merge "Add back client module" 2018-02-01 05:26:21 +00:00
tengqm 8dd4afab50 Add back client module
The removal of the Client module breaks downstream consumers such as
heat. This patch adds it back.

Change-Id: I422bd6e9ab0cbb985380f1b898435344f1dd8ac9
2018-01-31 03:30:58 -05:00
Yuanbin.Chen e6cdf2dac8 Receiver update faild when action value None
This patch fix action default value None, schem
'ClusterActionName' check, the None not in CLUSTER_ACTION_NAMES

Closes-bug: #1746391
Change-Id: I6b867611f99fc9fd35f08da8d225101ae3c3831e
2018-01-31 10:13:47 +08:00
Yuanbin.Chen cc62587035 Add basic functional tests
This patch add openstack client call, use openstack client
execute profile, policy, cluster, node, receiver, action,
event list operation.

Change-Id: I7f2a60c276f82ad9afab8130fea73fde078eff07
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-01-24 23:55:43 +08:00
Erik Olof Gunnar Andersson f598fd23e1 Refactored make_client
There were two code paths that did the same thing, and while
the code paths did the same thing, one of them supported region_name
and the other one did not.

Moving all this functionality into a single function to prevent this
from happening in the future.

- Re-factored make_client and create_connection.
- Remove now unused sdk.py.
- Renamed test_sdk to test_plugin.

Change-Id: Ibb477290c90e9af51be3537d11cf5142041db37f
2018-01-22 22:30:18 -08:00
Christopher Stone 7a764c9bd8 Add support for region_name and interface for client connection
Change-Id: I16aa9fc49221e26727676030c1a052b2c6b743ef
Related-Bug: #1744190
2018-01-18 18:49:52 -08:00
Yuanbin.Chen 37da9988e4 Fix cluster/node force delete parameter location error
Change-Id: If879add2eba71b61988a94eb6497597b0d0cf3c3
Closes-Bug: 1742071
2018-01-10 01:07:55 +08:00