Skip to content

Commit e272473

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Setup deprecate msg for command.py"
2 parents d3cd322 + ec630e0 commit e272473

1 file changed

Lines changed: 8 additions & 38 deletions

File tree

openstackclient/common/command.py

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,15 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

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.
1717

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
2319

24-
from openstackclient.i18n import _
20+
from osc_lib.command import * # noqa
2521

2622

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

Comments
 (0)