Skip to content

Commit

Permalink
chore: add deprecation warning for legacy key
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Mar 2, 2024
1 parent 7b46c5e commit fbd43fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nvchecker/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def __init__(

def get_key(self, name: str, legacy_name: Optional[str] = None) -> Optional[str]:
'''Get the named key (token) in the keyfile.'''
if self.keys.get(legacy_name):
logger.warning(
"You're using a legacy key name for your token, please check the docs to updade."
" Legacy keys will be removed, eventually.", key=legacy_name)
keyfile_token = self.keys.get(name) or self.keys.get(legacy_name)
netrc_entry: Optional[Tuple[str, str, str]]
netrc_entry = self.netrc.get(name)
Expand Down

0 comments on commit fbd43fd

Please sign in to comment.