Skip to content

Commit 495e7cc

Browse files
committed
Bugzilla: Print interactive_login warning when API keys are available
Point users explicitly to API keys, because tokens will be removed in future bugzilla releases Closes: #93 Signed-off-by: Cole Robinson <[email protected]>
1 parent 5db4ea2 commit 495e7cc

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

bugzilla/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,9 @@ def interactive_login(self, user=None, password=None, force=False,
667667
msg = "Login successful."
668668
if "token" in out and self.tokenfile:
669669
msg += " Token cache saved to %s" % self.tokenfile
670+
if self._get_version() >= 5.0:
671+
msg += "\nToken usage is deprecated. "
672+
msg += "Consider using bugzilla API keys instead."
670673
print(msg)
671674

672675
def logout(self):

tests/test_cli_login.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def test_login(run_cli):
7070
out = run_cli(cmd, fakebz)
7171
assert "Token cache saved" in out
7272
assert fakebz.tokenfile in out
73+
assert "Consider using bugzilla API" in out
7374

7475

7576
def test_interactive_login(monkeypatch, run_cli):

0 commit comments

Comments
 (0)