Remove deprecation warnings for the role command

The `role` commands are warning users that they have been deprecated
and informing users that they should use the alternative `roles`
commands. Sadly, we have no such `roles` plugin, so following the
deprecation warning provides false information which results in an
error should the command be used.

This change removes the deprecations warnings for the `role` commands.
If this needs to be refactored later we can; however, given the
information is wrong and there's no alternative plugin to use, making
the UX bad, we're removing the misinformation.

Change-Id: Ie048cdbe52f5b935ddd4b42febb373f9ff96d8d8
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
Kevin Carter 2021-07-10 15:06:39 -05:00
parent a013ba0688
commit f0f1d271a1
No known key found for this signature in database
GPG Key ID: 5045BC941175BDF5
1 changed files with 2 additions and 11 deletions

View File

@ -90,29 +90,22 @@ class RolesGenerate(RolesBaseCommand):
class RoleList(RolesBaseCommand):
"""List availables roles (DEPRECATED).
"""List availables roles."""
Please use "openstack overcloud roles list" instead.
"""
def get_parser(self, prog_name):
parser = super(RoleList, self).get_parser(prog_name)
return parser
def take_action(self, parsed_args):
self.log.debug('take_action({})'.format(parsed_args))
self.log.warning('This command is deprecated. Please use "openstack '
'overcloud roles list" instead.')
roles_path = os.path.realpath(parsed_args.roles_path)
roles = rolesutils.get_roles_list_from_directory(roles_path)
print('\n'.join(roles))
class RoleShow(RolesBaseCommand):
"""Show information about a given role (DEPRECATED).
"""Show information about a given role."""
Please use "openstack overcloud roles show" intead.
"""
def get_parser(self, prog_name):
parser = super(RoleShow, self).get_parser(prog_name)
parser.add_argument('role', metavar='<role>',
@ -121,8 +114,6 @@ class RoleShow(RolesBaseCommand):
def take_action(self, parsed_args):
self.log.debug('take_action({})'.format(parsed_args))
self.log.warning('This command is deprecated. Please use "openstack '
'overcloud roles show" instead.')
roles_path = os.path.realpath(parsed_args.roles_path)
role_name = parsed_args.role
file_path = os.path.join(roles_path, '{}.yaml'.format(role_name))