|
12 | 12 | # License for the specific language governing permissions and limitations |
13 | 13 | # under the License. |
14 | 14 |
|
15 | | -import abc |
16 | | -import logging |
| 15 | +# NOTE(dtroyer): This file is deprecated in Jun 2016, remove after 4.x release |
| 16 | +# or Jun 2017. |
17 | 17 |
|
18 | | -from cliff import command |
19 | | -from cliff import lister |
20 | | -from cliff import show |
21 | | -from osc_lib import exceptions |
22 | | -import six |
| 18 | +import sys |
23 | 19 |
|
24 | | -from openstackclient.i18n import _ |
| 20 | +from osc_lib.command import * # noqa |
25 | 21 |
|
26 | 22 |
|
27 | | -class CommandMeta(abc.ABCMeta): |
28 | | - |
29 | | - def __new__(mcs, name, bases, cls_dict): |
30 | | - if 'log' not in cls_dict: |
31 | | - cls_dict['log'] = logging.getLogger( |
32 | | - cls_dict['__module__'] + '.' + name) |
33 | | - return super(CommandMeta, mcs).__new__(mcs, name, bases, cls_dict) |
34 | | - |
35 | | - |
36 | | -@six.add_metaclass(CommandMeta) |
37 | | -class Command(command.Command): |
38 | | - |
39 | | - def run(self, parsed_args): |
40 | | - self.log.debug('run(%s)', parsed_args) |
41 | | - return super(Command, self).run(parsed_args) |
42 | | - |
43 | | - def validate_os_beta_command_enabled(self): |
44 | | - if not self.app.options.os_beta_command: |
45 | | - msg = _('Caution: This is a beta command and subject to ' |
46 | | - 'change. Use global option --os-beta-command ' |
47 | | - 'to enable this command.') |
48 | | - raise exceptions.CommandError(msg) |
49 | | - |
50 | | - |
51 | | -class Lister(Command, lister.Lister): |
52 | | - pass |
53 | | - |
54 | | - |
55 | | -class ShowOne(Command, show.ShowOne): |
56 | | - pass |
| 23 | +sys.stderr.write( |
| 24 | + "WARNING: %s is deprecated and will be removed after Jun 2017. " |
| 25 | + "Please use osc_lib.command\n" % __name__ |
| 26 | +) |
0 commit comments