Skip to content

Commit 1a6bf48

Browse files
committed
base: Fix implied disconnect() on connect() call
Apparently we can't check self._proxy like that, since it tries to look up data on the remote connection. Check self._transport instead, and add a test case. https://lists.fedoraproject.org/archives/list/[email protected]/message/MEXHTFZLHXFVFA3DDRYPISMNZNFX4RER/
1 parent 2ea85ae commit 1a6bf48

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

bugzilla/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def connect(self, url=None):
486486
If 'user' and 'password' are both set, we'll run login(). Otherwise
487487
you'll have to login() yourself before some methods will work.
488488
'''
489-
if self._proxy:
489+
if self._transport:
490490
self.disconnect()
491491

492492
if url is None and self.url:

tests/ro_functional.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ class RHTest(BaseTest):
248248
test14 = lambda s: BaseTest._testQueryOneline(s, "720784",
249249
" CVE-2011-2527")
250250

251+
def testDoubleConnect(self):
252+
bz = self.bzclass(url=self.url)
253+
bz.connect(self.url)
254+
251255
def testQueryFlags(self):
252256
bz = self.bzclass(url=self.url)
253257
if not bz.logged_in:

0 commit comments

Comments
 (0)