Properly deprecate the old location to the ARA callback

In the commit 582167d386 we relocated
the ARA callback plugin and broke backwards compatibility.
With some work, we were able to provide backwards compatibility
and properly deprecate it for removal.

Change-Id: Ibccbacdd0e93e6ccb4b3f449c55f9a9b6f40e46a
This commit is contained in:
David Moreau-Simard 2016-10-20 17:43:18 -04:00
parent 686283e111
commit 562bff53ec
4 changed files with 58 additions and 2 deletions

0
ara/callback/__init__.py Normal file
View File

47
ara/callback/log_ara.py Normal file
View File

@ -0,0 +1,47 @@
# Copyright 2016 Red Hat, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from debtcollector import moves
from ara.plugins.callbacks import log_ara
long_message = """[WARNING]
ara.callback has been moved to ara.plugins.callbacks.
Please update your Ansible Callback Plugins path to include
<path>/ara/plugins/callbacks
instead of:
<path>/ara/callback
<path>/ara/callback will be removed in a future version.
For more details, please refer to the latest available documentation."""
message = 'ara.callback has been moved to ara.plugins.callbacks'
print(long_message)
CommitAfter = moves.moved_class(log_ara.CommitAfter, 'CommitAfter',
'ara',
version='0.10.0',
removal_version='?',
message=message)
IncludeResult = moves.moved_class(log_ara.IncludeResult, 'IncludeResult',
'ara',
version='0.10.0',
removal_version='?',
message=message)
CallbackModule = moves.moved_class(log_ara.CallbackModule, 'CallbackModule',
'ara',
version='0.10.0',
removal_version='?',
message=message)

View File

@ -8,7 +8,15 @@ The callback comes provided when installing ARA but you need to let Ansible
know where it is located.
Set up your `ansible.cfg`_ file to seek that callback in the appropriate
directory. Here's an example that covers most common locations::
directory. If you are not sure where ARA will end up being installed, here's
an example that covers most common locations:
.. warning:: Prior to version 0.10 of ARA, the path to the ARA callback plugin
was at ``ara/callback``.
This path has since then been deprecated and moved to
``ara/plugins/callbacks``.
::
[defaults]
callback_plugins = /usr/lib/python2.7/site-packages/ara/plugins/callbacks:$VIRTUAL_ENV/lib/python2.7/site-packages/ara/plugins/callbacks:/usr/local/lib/python2.7/dist-packages/ara/plugins/callbacks

View File

@ -8,4 +8,5 @@ cliff
setuptools>=11.3
ansible!=2.0.2.0,>=2.0.1.0
pymysql
pygments
pygments
debtcollector>=1.2.0