equal
deleted
inserted
replaced
335 @deprecated('[3.19] explicitly use RepoAccess object in test instead') |
335 @deprecated('[3.19] explicitly use RepoAccess object in test instead') |
336 def login(self, login, **kwargs): |
336 def login(self, login, **kwargs): |
337 """return a connection for the given login/password""" |
337 """return a connection for the given login/password""" |
338 __ = kwargs.pop('autoclose', True) # not used anymore |
338 __ = kwargs.pop('autoclose', True) # not used anymore |
339 if login == self.admlogin: |
339 if login == self.admlogin: |
340 # definitly don't want autoclose when used as a context manager |
340 # undo any previous login, if we're not used as a context manager |
341 clt_cnx = repoapi.ClientConnection(self._admin_session) |
341 self.restore_connection() |
|
342 return self.cnx |
342 else: |
343 else: |
343 if not kwargs: |
344 if not kwargs: |
344 kwargs['password'] = str(login) |
345 kwargs['password'] = str(login) |
345 clt_cnx = repoapi.connect(self.repo, login, **kwargs) |
346 clt_cnx = repoapi.connect(self.repo, login, **kwargs) |
346 self.set_cnx(clt_cnx) |
347 self.set_cnx(clt_cnx) |