Commit Graph

589 Commits

Author SHA1 Message Date
Dale Smith fb28368899 Bugfix: master_lb_enabled flag now works as intended.
The value for master_lb_enabled resulted in it being treated the
same as master_lb_disabled.

Change-Id: Ia11d9e1ba20dbb37cd6467c2ae0555ddf25df5d3
Closes-Bug: #2039040
2023-10-11 13:14:43 +00:00
ricolin ef63e2e1bb Allow directly output cluster config
Allow cluster config directly return configs instead of writing file.
This is useful when using magnum client utils from non-commandline
interfaces.

Change-Id: Ie6717e1f2d673fe3e92c58a926a82f255a6d20ca
2023-08-09 18:28:09 +08:00
Jake Yip 7d9f02bd23 Fix multi-line strings spaces
Change-Id: Ia97821dcde54b46a8ff31dd13657a69a007ccd9a
2023-07-29 09:55:44 +10:00
Travis Holton de11f40d0c Update client.authentication.k8s.io api version for kubeconfig
The v1alpha1 version is removed in kubernetes 1.24. v1beta1 was added in
Kubernetes 1.11 and should be supported through existing versions.

Change-Id: I446b8c1c9b46fb8d70317f271a6a650d2a1bbefa
2023-02-16 06:29:39 +00:00
Diogo Guerra 7ad1c27ed7 Drop bay and baymodel
Story: 2009104
Task: 42956

Signed-off-by: Diogo Guerra <diogo.filipe.tomas.guerra@cern.ch>
Change-Id: I8f0076cae90a59c1d9ffca827eb0e80abe9b10d7
2022-09-05 10:12:06 +00:00
Felipe Reyes 972aff0f32 Fix test_help_on_subcommand on Python 3.10
Python 3.10 changed the way the optional arguments defined in argparse
are listed in the help output, the title was changed from "Optional
arguments" to "Options".

This checks the python version where the unit test is being executed and
uses the string that corresponds.

Story: 2009946
Task: 44858
Change-Id: Ibee09bf76399849f7da987c4661fa1945d27afb7
2022-03-25 09:49:14 -03:00
Zuul ab601bd7ab Merge "Fix master_lb_enabled for cluster creation" 2021-04-08 08:30:56 +00:00
Feilong Wang 282753384d Fix master_lb_enabled for cluster creation
The master_lb_enabled is not really working for disabled case.
This patch fix it by introducing the --master-lb-disabled param.

Story: 2008655
Task: 41924
Change-Id: I90db6d91dd3887fbec629ce5037d6a7e6f7c05e4
2021-04-08 04:34:34 +00:00
Zuul d558e4a255 Merge "Fix failing to parse json error msg" 2021-04-01 10:03:54 +00:00
Tobias Urdin f7551a6bac Fix failing to parse json error msg
It assumes its a requests response but could
be a HTTPResponse from urllib.

Story: 2008789
Task: 42183

Change-Id: I7306d167a17284c7f478ec1c1599a8d4b32040c2
2021-03-30 13:59:07 +00:00
Diogo Guerra 201b3527b0 Add CT tags argument and field to client
We noticed that from the user perspective it is hard
to know when a cluster_template provided by the cloud
admin is mature enough for a production release.
This field will allow the administrator to add an
annotation to the cluster template like
{deprecated, recommended, testing} giving further
usefull information to the end user about the
template's life cycle

This patch allows the magnumclient to pass the
--tags <text> when creating a cluster template
and also shows the observations available when listing
existent cluster templates.

story: 2004215
task: 40161

Depends-On: I5d1c4221f089bc5cd12b25f620aa01771a029df9
Change-Id: Ibbdc9a9cd7ae4733eb6d38a7db11a68866f0d446
Signed-off-by: Diogo Guerra <dy090.guerra@gmail.com>
2021-02-05 09:14:54 +00:00
Theodoros Tsioutsias 0799acf939 Nodegroup min_node_count should default to 0
This changes the default value for nodegroups min_node_count to 0.
Scaling nodegroups to 0 is also allowed.

Change-Id: I74dd0d34990b71b290b6ccbe707afb8cc7ae7340
Depends-On: Id63459d0fe9836e678bb7569f23d29eabc225e9e
story: 2007851
task: 40147
2021-02-04 13:27:30 +00:00
Jake Yip d549651f6d Show docker_volume_size in `cluster show`
docker_volume_size is an parameter for creating cluster, it should also
be displayed when showing it

Change-Id: I354043496cc60a99c362f7d8bf36d5ca27ed6d30
2020-10-22 14:58:37 +11:00
Bharat Kunwar 3da3b4896f Use overlay2 driver by default
Also print deprecation message for devicemapper and overlay.

Change-Id: Idff7f518485528da45430ae85a1580ed9d306330
2020-07-10 15:22:07 +00:00
Hervé Beraud 190a34b04d Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Change-Id: Iaf13c7dc3cf908d3755116ac861f732c220e324d
2020-07-10 14:20:56 +00:00
Zuul 82bdfe0bfb Merge "Print response after issuing CA rotate request" 2020-07-03 12:22:17 +00:00
Zuul 047cd8ae2b Merge "Show cluster fixed_network, fixed_subnet, floating_ip_enabled" 2020-07-03 12:19:44 +00:00
Feilong Wang c6b7952982 Support master_lb_enabled when creating cluster
Task: 40263
Story: 2007634

Change-Id: I59ad158753f25a56219ecaa5a55dd3f0ae67965a
2020-07-03 14:04:16 +12:00
Bharat Kunwar 7ecbab5dbf Show cluster fixed_network, fixed_subnet, floating_ip_enabled
Since we are able to override the values in cluster scope, we should be
able to see them too.

Story: 2006208
Task: 40254

Change-Id: I6c615697a732566290418ea3a3dd3263cb817fb8
2020-07-01 10:56:59 +00:00
Feilong Wang c010846179 Print response after issuing CA rotate request
Change-Id: Ia58a316235c96d36ee4cb8c1b012565ae2489f9c
2020-06-25 14:51:58 +12:00
Hervé Beraud d66530fda8 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: Ifeaa5ba961c849a40407f4b3cc172f1423df3eaf
2020-06-02 20:49:16 +02:00
Zuul 1a1fe76a6a Merge "Rename variables to address pep8 error" 2020-05-18 08:40:27 +00:00
Zuul 6dc88e69fd Merge "Remove six" 2020-05-15 06:36:04 +00:00
Bharat Kunwar 1c1cfd7109 Rename variables to address pep8 error
Without rename, we see this:
    E741 ambiguous variable name 'l'

Change-Id: Ic1d357db594dd6f8f8db162033b6cf408e84453c
Story: 2007515
Task: 39775
2020-05-14 11:34:38 +00:00
Theodoros Tsioutsias 0febfc728f Labels override
This adds a boolean flag called --merge-labels at the create CLIs
for clusters and nodegroups. The show output for clusters and
nodegroups is modified to contain also new fields called
"labels_overridden", "labels_added", "labels_skipped". The new labels
contain the differences of the object's labels with its parent's.

story: 2007515
task: 39692
Depends-On: I1054c54da96005a49e874de6f4cf60b5db57fc02
Change-Id: Ie68bb85f4b8bbacc5b71b523d8639cf30e6e1992
2020-05-14 10:14:22 +00:00
jacky06 038146d500 Remove six
We don't need this in a Python 3-only world.

Change-Id: I7f39c971de09684ad34cdd21ae6819bde797efb0
2020-05-06 00:42:29 +08:00
Zuul ec27571c90 Merge "Fix raw_request of SessionClient" 2020-04-30 13:03:32 +00:00
Feilong Wang ffcaae4f27 Fix raw_request of SessionClient
The the raw_request of SessionClient should return two variables
to be compatible with others.

Change-Id: I2900a08cbf08147791e0a2f41d13b42a43f6897e
Task: 39592
Story: 2007605
2020-04-30 10:29:40 +12:00
Zuul b04a7335df Merge "Use unittest.mock instead of third party mock" 2020-04-29 10:49:48 +00:00
Zuul 7d4601d0d7 Merge "Refactor the getid method base.py" 2020-04-29 08:19:52 +00:00
Feilong Wang df0249024e Support updating cluster health status
Cluster health_status_reason is also a dict like the template labels,
so we need to handle this in the same way.

Change-Id: I0841ef30f568640839746f2223ba0fb621e2005c
Task: 39081
Story: 2007242
2020-04-19 21:28:22 +00:00
Sean McGinnis 3eafa2a001
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: I4a5b1ec999110a50fc904f3ae93e3983efa64f88
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:58:37 -05:00
Tobias Urdin c024b4fc43 Check response type in _extract_error_json
The response being passed to _extract_error_json
is assumed to be a requests.Response but can also
be a http.client.HTTPResponse.

This patch adds a try statement where it first tries
for a requests.Response and if not set falls back on
parsing the string body instead of trying to use the
json() helper function in requests.Response.

Change-Id: I61840d284b5d3a249f621822b277c9bd6825140d
Closes-Bug: 1870264
2020-04-08 09:46:58 +00:00
Zuul 18f5928215 Merge "Bugfix: Use fields option for cluster template list" 2020-03-31 09:39:50 +00:00
Andreas Jaeger 5d93b51900 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 2.0 which
supports Python 3.

Fix problems found.

Change-Id: I81cf5e317bb2f791888e75d87cfd27dfdd2b5f96
2020-03-28 15:54:06 +01:00
Jake Yip 5b7a671319 Bugfix: Use fields option for cluster template list
`openstack cluster template list` accepts a `fields` option, but this
was not used. Fixed it to have some behaviour as legacy magnum client.

Also fixed tests.

Change-Id: I0d75f4b597a46b652c082ead3db5e3ad0b56b479
2020-01-14 14:32:17 +11:00
Spyros Trigazis c0d3683608 Allow cluster config for any cluster state
Similar to what the certificates api does, it doesn't make sense to
disallow cluster config.

story: 2006651
task: 36891

Change-Id: Ia57e95e4570d04c2a20f7674d1ae3e21b8dd8efb
Signed-off-by: Spyros Trigazis <spyridon.trigazis@cern.ch>
2019-10-03 12:26:00 +00:00
Theodoros Tsioutsias 934cf54854 Add nodegroup CRUD commands
The commands added are:

* openstack coe nodegroup create <params> <cluster> <nodegroup>
* openstack coe nodegroup delete <cluster> <nodegroup>
* openstack coe nodegroup update <op> <params> <cluster> <nodegroup>

Depends-On: I4ad60994ad6b4cb9cac18129557e1e87e61ae98c
Change-Id: I98b662b5a95f16d80852e3b30683c75e78acb3e5
2019-09-26 08:15:40 +00:00
Feilong Wang 5ad8b7dcf7 Support network, subnet and FIP when creating cluster
Change-Id: Ia4f1ce4be215262fc89ceac30a2edb878ebd9937
Task: 36027
Story: 2006208
2019-07-30 15:44:53 +12:00
Zuul d29d5cdec4 Merge "Support upgrade API" 2019-07-12 14:24:13 +00:00
Bharat Kunwar c72512d41a Conditional hidden arg for backward compatibility
At the moment, the python-magnumclient supplies the "hidden" arg when
creating cluster/cluster templates which is not backward compatible with
pre-Stein Magnum. This patch addresses the issue.

Story: 2005539
Task: 30678

Change-Id: Ib2c17cc0c244a89c700f309dc7dd971596fb0957
2019-06-03 20:02:50 +10:00
Feilong Wang d91d4c72a1 Display project_id for cluster show
It would be useful for cloud admin/ops to display the project_id
in cluster show.

Task: 30676
Story: 2005537

Change-Id: I0f1ae84cf2238ebbf8fc30237d88c7db1eeba6dd
2019-05-01 10:00:49 +12:00
Theodoros Tsioutsias ea7c571162 Add nodegroup list/show commands
This adds the commands needed to list and show nodegroups in a
cluster. Specifically the commands added are:

* openstack coe nodegroup list <cluster>
* openstack coe nodegroup show <cluster> <nodegroup>

Depends-On: I5607c27eb0e84677acda29af006335374b60dd27
Change-Id: I910c7c7caff34aba2ce08ca5c9362403d11f324c
2019-03-27 16:27:10 +00:00
Feilong Wang 6b756aa75f Support upgrade API
Task: 30168
Story: 2002210

Change-Id: I458985f97e1e9bbe89702ce04e74bdcf66e36244
2019-03-26 21:19:32 +13:00
Feilong Wang 94380f9ad5 Support resize api
Task: 29572
Story: 2005054

Change-Id: Ic9ede21bbf87883d7dbdf9fde02e7dba24440ce7
2019-03-25 11:03:10 +13:00
Zuul c79d673096 Merge "Add hidden property to cluster template" 2019-03-11 08:47:15 +00:00
Zuul 6dfad64af4 Merge "Support health_status on client side" 2019-03-07 11:20:41 +00:00
Feilong Wang 74c5f22c6f Support health_status on client side
Task: 29762
Story: 2002742

Depends-on: If702584fabe1402257b45db281561a5f5b83b972
Change-Id: Iffce9a2cc422bbce70152be3a58d2573e80b104b
2019-03-07 10:56:51 +00:00
Jake Yip 3f7b994acd python3 fixes
Update uses of b64encode() as describe in OpenStack docs [1].

Also add tests.

[1]: https://wiki.openstack.org/wiki/Python3#Serialization:_base64.2C_JSON.2C_etc.

Change-Id: I5aa6ba509979e0532d2837153aa5363d1e13631e
2019-03-01 13:17:10 +11:00
Zuul 37e602d160 Merge "Keystone auth support" 2019-02-28 16:19:54 +00:00