diff --git a/magnumclient/common/cliutils.py b/magnumclient/common/cliutils.py index 8db1cb1d..34ab129b 100644 --- a/magnumclient/common/cliutils.py +++ b/magnumclient/common/cliutils.py @@ -50,6 +50,10 @@ CLUSTER_DEPRECATION_HELP = DEPRECATION_BASE % ('', 'cluster', 'cluster', CLUSTER_DEPRECATION_WARNING = DEPRECATION_BASE % ( 'WARNING: ', 'cluster', 'cluster', 'to avoid seeing this message') +MAGNUM_CLIENT_DEPRECATION_WARNING = ( + 'WARNING: The magnum client is deprecated and will be removed in a future ' + 'release.\nUse the OpenStack client to avoid seeing this message.') + def deprecation_message(preamble, new_name): msg = ('%s This parameter is deprecated and will be removed in a future ' diff --git a/magnumclient/v1/certificates_shell.py b/magnumclient/v1/certificates_shell.py index f9530323..f73f6432 100644 --- a/magnumclient/v1/certificates_shell.py +++ b/magnumclient/v1/certificates_shell.py @@ -53,6 +53,7 @@ def _get_target_uuid(cs, args): default=None, help=(_('ID or name of the cluster. %s') % utils.CLUSTER_DEPRECATION_HELP)) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_ca_show(cs, args): """Show details about the CA certificate for a bay or cluster.""" utils.validate_cluster_args(args.postional_cluster, args.cluster) @@ -77,6 +78,7 @@ def do_ca_show(cs, args): required=False, metavar='', help=_('ID or name of the cluster.')) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_ca_sign(cs, args): """Generate the CA certificate for a bay or cluster.""" opts = { @@ -98,6 +100,7 @@ def do_ca_sign(cs, args): required=True, metavar='', help=_('ID or name of the cluster.')) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_ca_rotate(cs, args): """Rotate the CA certificate for a bay or cluster to revoke access.""" cluster = cs.clusters.get(args.cluster) diff --git a/magnumclient/v1/cluster_templates_shell.py b/magnumclient/v1/cluster_templates_shell.py index 16ea9fea..32a1aa57 100644 --- a/magnumclient/v1/cluster_templates_shell.py +++ b/magnumclient/v1/cluster_templates_shell.py @@ -187,6 +187,7 @@ def _show_cluster_template(cluster_template): @utils.arg('--insecure-registry', metavar='', help='url of docker registry') +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_template_create(cs, args): """Create a cluster template.""" args.command = 'cluster-template-create' @@ -235,6 +236,7 @@ def do_cluster_template_create(cs, args): metavar='', nargs='+', help=_('ID or name of the (cluster template)s to delete.')) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_template_delete(cs, args): """Delete specified cluster template.""" for cluster_template in args.cluster_templates: @@ -251,6 +253,7 @@ def do_cluster_template_delete(cs, args): @utils.arg('cluster_template', metavar='', help=_('ID or name of the cluster template to show.')) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_template_show(cs, args): """Show details about the given cluster template.""" cluster_template = cs.cluster_templates.get(args.cluster_template) @@ -280,6 +283,7 @@ def do_cluster_template_show(cs, args): action='store_true', default=False, help=_('Show detailed information about the cluster templates.') ) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_template_list(cs, args): """Print a list of cluster templates.""" nodes = cs.cluster_templates.list(limit=args.limit, @@ -314,6 +318,7 @@ def do_cluster_template_list(cs, args): default=[], help=_("Attributes to add/replace or remove " "(only PATH is necessary on remove)")) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_template_update(cs, args): """Updates one or more cluster template attributes.""" patch = magnum_utils.args_array_to_patch(args.op, args.attributes[0]) diff --git a/magnumclient/v1/clusters_shell.py b/magnumclient/v1/clusters_shell.py index bbdb31b0..81e77e7d 100644 --- a/magnumclient/v1/clusters_shell.py +++ b/magnumclient/v1/clusters_shell.py @@ -57,6 +57,7 @@ def _show_cluster(cluster): 'create_timeout' ) ) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_list(cs, args): """Print a list of available clusters.""" clusters = cs.clusters.list(marker=args.marker, limit=args.limit, @@ -129,6 +130,7 @@ def do_cluster_list(cs, args): default=60, help=_('The timeout for cluster creation in minutes. The default ' 'is 60 minutes.')) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_create(cs, args): """Create a cluster.""" args.command = 'cluster-create' @@ -166,6 +168,7 @@ def do_cluster_create(cs, args): metavar='', nargs='+', help=_('ID or name of the (cluster)s to delete.')) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_delete(cs, args): """Delete specified cluster.""" for id in args.cluster: @@ -184,6 +187,7 @@ def do_cluster_delete(cs, args): @utils.arg('--long', action='store_true', default=False, help=_('Display extra associated cluster template info.')) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_show(cs, args): """Show details about the given cluster.""" cluster = cs.clusters.get(args.cluster) @@ -216,6 +220,7 @@ def do_cluster_show(cs, args): default=[], help=_("Attributes to add/replace or remove " "(only PATH is necessary on remove)")) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_update(cs, args): """Update information about the given cluster.""" if args.rollback and args.magnum_api_version and \ @@ -246,6 +251,7 @@ def do_cluster_update(cs, args): @utils.arg('--force', action='store_true', default=False, help=_('Overwrite files if existing.')) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_cluster_config(cs, args): """Configure native client to access cluster. diff --git a/magnumclient/v1/stats_shell.py b/magnumclient/v1/stats_shell.py index a5f25d00..f70a3fdd 100644 --- a/magnumclient/v1/stats_shell.py +++ b/magnumclient/v1/stats_shell.py @@ -18,6 +18,7 @@ from magnumclient.i18n import _ required=False, metavar='', help=_('Project ID')) +@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING) def do_stats_list(cs, args): """Show stats for the given project_id""" opts = {