cli: add support for deprecated tower-cli aliases in py2

This commit is contained in:
Ryan Petrello
2019-09-03 21:08:28 -04:00
parent ba8b876dd3
commit b888c4b75a
3 changed files with 30 additions and 4 deletions

View File

@@ -137,9 +137,10 @@ def parse_resource(client, skip_deprecated=False):
# argparse aliases are *only* supported in Python3 (not 2.7)
kwargs = {}
if not skip_deprecated and PY3:
if not skip_deprecated:
if k in DEPRECATED_RESOURCES:
kwargs['aliases'] = [DEPRECATED_RESOURCES[k]]
client.subparsers[k] = subparsers.add_parser(
k, help='', **kwargs
)