Commit Graph

15 Commits

Author SHA1 Message Date
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
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
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
Daniel Abad 05ccd7f5fc Add deprecation warnings to magnum client commands
In order to enforce the transition to the new
OpenStack client, added deprecation warnings to the
magnum cluster-list, cluster-show, cluster-update,
cluster-delete, cluster-config, cluster-create,
cluster-template-list, cluster-template-show,
cluster-template-create, cluster-template-delete,
cluster-template-update, ca-sign, ca-rotate,
ca-show and stats-list, commands.

Change-Id: I0103f686e0feb4dad4173ba7aa00768c8e25440d
Partially-Implements: blueprint deprecate-magnum-client
2018-02-27 12:24:35 +00:00
Madhuri Kumari e790a30967 Make cluster name positional in ca-show
cluster name is mandatory argument to ca-show command, so
this patch makes it positional.

Change-Id: I7e8446a0c8713feadf4bce588dec1dcde5a6f5bd
2017-07-23 12:49:00 +00:00
Jason Dunsmore cb8edde0b6 Allow name as positional argument
Make "magnum cluster-create" and "magnum cluster-template-create"
accept name as a positional like the other magnum subcommands.

Implements: blueprint positional-name
Change-Id: Ie505ef8ea7e4c13ed2795cde826b9822d094aaeb
2017-02-22 14:06:14 -05:00
Jenkins 91bac9bd79 Merge "Implement Parameter Deprecation" 2016-11-15 19:28:23 +00:00
Stephen Watson e7f084dfa9 Implement Parameter Deprecation
Implements parameter deprecation for magnum client via decorator
in cliutils.py and additional logic in magnumclient/shell.py.

Logic in shell creates mutual exclusive (mutex) groups in argparse
to enable parameter checking for required and unrequired parameters
specifically to check for old parameters that are being deprecated
in favor of newer ones.

Change-Id: Ic72c876e556070a066b1693a119a389301dfa259
Implements: blueprint rename-id-parameter-names
2016-11-15 09:58:03 -07:00
gecong1973 3ebbac601e Remove white space between print and ()
TrivialFix

Change-Id: I8575e507aa2e72bc7305099a88825530ff684078
2016-10-11 10:12:39 +08:00
Stephen Watson d9ae385588 Adds 'cluster' and 'cluster template'
Add new base classes for Bay and Cluster to inherit from.
Add new tests for cluster and cluster_template code.
Leaves all commands in-place and adds new cluster-related
commands for magnumclient.
Add deprecation decorator and messages for bay/baymodel.

Implements: blueprint rename-bay-to-cluster
Change-Id: I64e1aa6a71b109687568005655c6de55f86fad29
2016-08-23 17:14:23 +00:00
PanFengyun 11b49d6c97 Prints '-' instead of 'None' when data is None
Client prints 'None' when data is None , and client also prints
'None' when data is a string 'None'. But string 'None' is  different
to None. To clear the confusion, Client should print '-' instead of
'None' when data is None. Nova Client and Cinder Client has cleared
the confusion.

Change-Id: I5b7013eb7ccfb99658702066191feed93f82fb8a
Related-Bug: #1600553
Closed-Bug: #1422244
2016-07-10 19:08:02 +08:00
Anh Tran d6a697cabb Add '--fields' to show more columns for bay-list
This patch does:
  - move '_get_list_table_columns_and_formatters' function
    to cliutils.
  - add '--fields' to 'bay-list' command to show more
    specific fields.
  - add test case for bay-list with '--fields'.

Change-Id: I2fdd66f0c6648bb2c6ae65325cbba3656b9854f6
Closes-Bug: #1535687
2016-05-17 13:20:44 +07:00
Anh Tran d65a5b5b38 Add '--fields' to show more columns for baymodel-list
This patch adds '--fields' to 'baymodel-list' command to show more
specific fields.

Available fields for listing baymodels:
  -- uuid
  -- name
  -- coe
  -- image_id
  -- apiserver_port
  -- registry_enabled
  -- server_type
  -- public
  -- links
  -- tls_disabled

Change-Id: Ie887574d6e8a2ddda25e042317dd98c781016c80
Closes-Bug: #1551574
2016-05-13 14:11:23 +07:00
Yang Hongyang c7d2bbfc0f Sync with oslo-incubator
Apiclient[1] and cliutils[2] is removed form Oslo incubator, we should keep
the local copy by ourself.
1. copy openstack/common/apiclient to common/apiclient
2. only keep base, auth, exceptions from apiclient, others are unused
3. copy openstack/common/cliutils.py to common/cliutils.py
4. update all magnumclient.openstack.common.* users to use
   magnumclient.common.*

This is the first step to delete openstack common modules.

[1] Change: I2020d73fa9cedb3b3b87c1d8dbc8d437857ec7c2
[2] Change: Ibc5a8f11c6e5c308cec15a60eeb07a898254f9b7

Partial-Bug: #1545957
Change-Id: Ide3814d87ecdf3255868bf3b78fdceb58bd14295
2016-02-18 13:06:00 +08:00