#1134 frontend: provide alias commands with underscores in ./manage.py
Merged 3 years ago by kparal. Opened 4 years ago by praiskup.

@@ -3,6 +3,7 @@

  

  import os

  import sys

+ import copy

  import pipes

  import importlib

  import click
@@ -84,8 +85,19 @@

  ]

  

  for command in commands_list:

-     command_func = getattr(getattr(commands, command), command)

-     app.cli.add_command(command_func)

+     cmd_obj = getattr(getattr(commands, command), command)

+ 

+     # Add underscored commands, e.g. 'add_user' for 'add-user' for compatibility

+     # reasons.  TODO: we can drop this once we have the deployment scripts fixed

+     # to use the dash-variant commands.

+     if '_' in command and hasattr(cmd_obj, 'hidden'):

+         # hidden option is available on f30+ only (click v7.0)

+         alias = copy.deepcopy(cmd_obj)

+         alias.hidden = True

+         app.cli.add_command(alias, command)

+ 

+     app.cli.add_command(cmd_obj)

+ 

  

  app.cli.add_command(get_flask_wrapper_command('runserver'))

  app.cli.add_command(get_flask_wrapper_command('run'))

Previously we had commands like './manage.py add_user', but recently we
changed to 'add-user'. Provide a compatibility options with the
previous syntax so we don't have force everyone to switch to new syntax
immediately.

Tagging release-blocker, we could easily forget about something in ansible.git.

Metadata Update from @praiskup:
- Pull-request tagged with: release-blocker

4 years ago

please add there comment when we can remove it, otherwise +1

rebased onto a721ee9

4 years ago

Pull-Request has been merged by praiskup

4 years ago

Commit 00025842 fixes this pull-request

Pull-Request has been merged by kparal

3 years ago

@kparal, I'm curious what are you testing here :-)

Huh. I have no idea. It must be some Pagure bug.