Document and align the env var for OAuth token

This commit is contained in:
AlanCoding
2020-04-07 10:00:02 -04:00
parent d40143a63d
commit b90a296d41
29 changed files with 33 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ value:
.. code:: bash
export TOWER_TOKEN=6E5SXhld7AMOhpRveZsLJQsfs9VS8U
export TOWER_OAUTH_TOKEN=6E5SXhld7AMOhpRveZsLJQsfs9VS8U
By ingesting this token, you can run subsequent CLI commands without having to
specify your username and password each time:

View File

@@ -89,5 +89,5 @@ A few of the most important ones are:
``--conf.password, TOWER_PASSWORD``
the AWX password to use for authentication
``--conf.token, TOWER_TOKEN``
``--conf.token, TOWER_OAUTH_TOKEN``
an OAuth2.0 token to use for authentication

View File

@@ -16,7 +16,7 @@ def add_authentication_arguments(parser, env):
)
auth.add_argument(
'--conf.token',
default=env.get('TOWER_TOKEN', ''),
default=env.get('TOWER_OAUTH_TOKEN', env.get('TOWER_TOKEN', '')),
help='an OAuth2.0 token (get one by using `awx login`)',
metavar='TEXT',
)

View File

@@ -102,7 +102,7 @@ class Login(CustomCommand):
else:
fmt = client.get_config('format')
if fmt == 'human':
print('export TOWER_TOKEN={}'.format(token))
print('export TOWER_OAUTH_TOKEN={}'.format(token))
else:
print(to_str(FORMATTERS[fmt]({'token': token}, '.')).strip())