Skip to content

Commit e427730

Browse files
authored
Corrects help text for tokens create --lifetime-seconds (#387)
Original value was missing a '* 60', if anyone actually used that value instead of the default the token expiration was only 36 hours.
1 parent c695b8d commit e427730

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

databricks_cli/tokens/cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@
2929
from databricks_cli.version import print_version_callback, version
3030

3131

32+
TOKEN_LIFETIME_SEC = 60 * 60 * 24 * 90
33+
34+
3235
@click.command(context_settings=CONTEXT_SETTINGS,
3336
short_help='Create a token.')
34-
@click.option('--lifetime-seconds', required=False, default=60 * 60 * 24 * 90,
35-
help="Number of seconds for the token to live for. The default is 129600 seconds or "
36-
"90 days.")
37+
@click.option('--lifetime-seconds', required=False, default=TOKEN_LIFETIME_SEC,
38+
help="Number of seconds for the token to live for. The default is %d seconds or "
39+
"%d days." % (TOKEN_LIFETIME_SEC, TOKEN_LIFETIME_SEC / 60 / 60 / 24))
3740
@click.option('--comment', required=True,
3841
help="String describing what the token is for.")
3942
@debug_option

0 commit comments

Comments
 (0)