From 1aecb41b7e31f0bef1bda6b7b6e0ae9fdfd5b123 Mon Sep 17 00:00:00 2001 From: Ryan Brady Date: Wed, 22 Oct 2014 11:17:56 -0400 Subject: [PATCH] Add deprecation warning when using map-services This patch writes a warning out to stderr to notify element authors that may be using map-services to migrate to svc-map. Change-Id: Ic80db16c607958d025e89b3a4058a9cbb568938e --- elements/debian/bin/map-services | 1 + elements/opensuse/bin/map-services | 6 +++++- elements/redhat-common/bin/map-services | 6 +++++- elements/ubuntu/bin/map-services | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/elements/debian/bin/map-services b/elements/debian/bin/map-services index 56429d9b..1c76303c 100755 --- a/elements/debian/bin/map-services +++ b/elements/debian/bin/map-services @@ -5,3 +5,4 @@ set -o pipefail # For Debian map-services is currently a noop # We pass through the service name directly echo "$@" +>&2 echo "WARNING: map-services has been deprecated. Please use svc-map." diff --git a/elements/opensuse/bin/map-services b/elements/opensuse/bin/map-services index 874c261a..28d2ae33 100755 --- a/elements/opensuse/bin/map-services +++ b/elements/opensuse/bin/map-services @@ -1,5 +1,5 @@ #!/usr/bin/env python - +# dib-lint: disable=indent # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright 2014 SUSE, Inc. # @@ -15,6 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. +from __future__ import print_function import os import sys @@ -50,6 +51,9 @@ service_map = { 'nova-scheduler': 'openstack-nova-scheduler', } +print("WARNING: map-services has been deprecated. " + "Please use the svc-map element.", file=sys.stderr) + for arg in sys.argv[1:]: # We need to support the service name being different when installing from # source vs. packages. So, if the requested service file already exists, diff --git a/elements/redhat-common/bin/map-services b/elements/redhat-common/bin/map-services index b2b749b9..d59daeed 100755 --- a/elements/redhat-common/bin/map-services +++ b/elements/redhat-common/bin/map-services @@ -1,5 +1,5 @@ #!/usr/bin/env python - +# dib-lint: disable=indent # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright 2014 Red Hat, Inc. # @@ -15,6 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. +from __future__ import print_function import os import sys @@ -67,6 +68,9 @@ service_map = { 'tgt': 'tgtd', } +print("WARNING: map-services has been deprecated. " + "Please use the svc-map element.", file=sys.stderr) + for arg in sys.argv[1:]: # We need to support the service name being different when installing from # source vs. packages. So, if the requested service file already exists, diff --git a/elements/ubuntu/bin/map-services b/elements/ubuntu/bin/map-services index 316cf0e9..1a81bb52 100755 --- a/elements/ubuntu/bin/map-services +++ b/elements/ubuntu/bin/map-services @@ -5,3 +5,4 @@ set -o pipefail # For Ubuntu map-services is currently a noop # We pass through the service name directly echo "$@" +>&2 echo "WARNING: map-services has been deprecated. Please use svc-map."