Skip to content

Commit

Permalink
Merge pull request #489 from nickbroon/url_hostname
Browse files Browse the repository at this point in the history
Support URL hostname in keyring
  • Loading branch information
adrianschroeter authored Jul 31, 2024
2 parents 867f062 + 861de49 commit bf9009a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions TarSCM/scm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ def __init__(self, args, task):
try:
self.password = _kr.get_password(self.url, args.user)
if not self.password:
raise Exception('No user {u} in keyring for service {s}'
.format(u=args.user, s=self.url))
# try just the hostname
url_netloc = urlparse(self.url)[1]
self.password = _kr.get_password(url_netloc, args.user)
if not self.password:
raise Exception(
'No user {u} in keyring for service {s}'
.format(u=args.user, s=self.url))
except AssertionError:
raise Exception('Wrong keyring passphrase')
self.user = args.user
Expand Down

0 comments on commit bf9009a

Please sign in to comment.