Deprecate nova-manage service subcommand
The novaclient already has the following service commands: service-disable Disable the service. service-enable Enable the service. service-list Show a list of all running services. host-describe Describe a specific host This covers what nova-manage service was providing so let's deprecate the legacy nova-manage subcommand and mark it for removal in the N release. UpgradeImpact: nova-manage service is deprecated, use novaclient DocImpact: update openstack operations guide Implements: bp deprecate-service-management-in-nova-manage Change-Id: I3e625dbf39f5831157104f5c368acd53b1899f76
This commit is contained in:
parent
876679c08f
commit
df840b3457
@ -107,6 +107,17 @@ def args(*args, **kwargs):
|
||||
return _decorator
|
||||
|
||||
|
||||
def deprecate(msg):
|
||||
"""Decorator which print the deprecation message before the decorated
|
||||
function is called
|
||||
"""
|
||||
@decorator.decorator
|
||||
def _deprecate(f, *args, **kwargs):
|
||||
print(msg, file=sys.stderr)
|
||||
return f(*args, **kwargs)
|
||||
return _deprecate
|
||||
|
||||
|
||||
def param2id(object_id):
|
||||
"""Helper function to convert various volume id types to internal id.
|
||||
args: [object_id], e.g. 'vol-0000000a' or 'volume-0000000a' or '10'
|
||||
@ -701,6 +712,12 @@ class VmCommands(object):
|
||||
class ServiceCommands(object):
|
||||
"""Enable and disable running services."""
|
||||
|
||||
description = ('DEPRECATED: Use the nova service-* commands from '
|
||||
'python-novaclient instead or the os-services REST '
|
||||
'resource. The service subcommand will be '
|
||||
'removed in the 14.0 release.')
|
||||
|
||||
@deprecate(description)
|
||||
@args('--host', metavar='<host>', help='Host')
|
||||
@args('--service', metavar='<service>', help='Nova service')
|
||||
def list(self, host=None, service=None):
|
||||
@ -733,6 +750,7 @@ class ServiceCommands(object):
|
||||
svc['availability_zone'], active, art,
|
||||
svc['updated_at']))
|
||||
|
||||
@deprecate(description)
|
||||
@args('--host', metavar='<host>', help='Host')
|
||||
@args('--service', metavar='<service>', help='Nova service')
|
||||
def enable(self, host, service):
|
||||
@ -747,6 +765,7 @@ class ServiceCommands(object):
|
||||
print((_("Service %(service)s on host %(host)s enabled.") %
|
||||
{'service': service, 'host': host}))
|
||||
|
||||
@deprecate(description)
|
||||
@args('--host', metavar='<host>', help='Host')
|
||||
@args('--service', metavar='<service>', help='Nova service')
|
||||
def disable(self, host, service):
|
||||
@ -815,6 +834,7 @@ class ServiceCommands(object):
|
||||
|
||||
return {'resource': resource, 'usage': usage}
|
||||
|
||||
@deprecate(description)
|
||||
@args('--host', metavar='<host>', help='Host')
|
||||
def describe_resource(self, host):
|
||||
"""Describes cpu/memory/hdd info for host.
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
other:
|
||||
- The service subcommand of nova-manage is deprecated. Use the nova
|
||||
service-* commands from python-novaclient instead or the os-services
|
||||
REST resource. The service subcommand will be removed in the 14.0 release.
|
||||
|
Loading…
Reference in New Issue
Block a user