Skip to content

Commit fe48fde

Browse files
authored
Merge pull request #851 from moreati/issue850
testlib: Don't assume `docker port` output matches regex
2 parents 580c9d5 + 3d35064 commit fe48fde

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.ci/prep_azure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@
8484
if need_to_fix_psycopg2:
8585
venv_steps.append('/tmp/venv/bin/pip3 install psycopg2==2.8.5 psycopg2-binary')
8686

87+
venv_steps.extend([
88+
# pbr is a transitive setup_requires of hdrhistogram. If it's not already
89+
# installed then setuptools attempts to use easy_install, which fails.
90+
'/tmp/venv/bin/pip install pbr==5.6.0',
91+
])
92+
8793
batches.append(venv_steps)
8894

8995
ci_lib.run_batches(batches)

tests/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ timeoutcontext==1.2.0
1212
unittest2==1.1.0
1313
# Fix InsecurePlatformWarning while creating py26 tox environment
1414
# https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
15-
urllib3[secure]; python_version < '2.7.9'
15+
urllib3[secure]==1.23; python_version < '2.7'
16+
urllib3[secure]==1.26; python_version > '2.6' and python_version < '2.7.9'
1617
# Last idna compatible with Python 2.6 was idna 2.7.
1718
idna==2.7; python_version < '2.7'

tests/testlib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,10 @@ class DockerizedSshDaemon(object):
423423
def _get_container_port(self):
424424
s = subprocess__check_output(['docker', 'port', self.container_name])
425425
for line in s.decode().splitlines():
426-
dport, proto, baddr, bport = self.PORT_RE.match(line).groups()
426+
m = self.PORT_RE.match(line)
427+
if not m:
428+
continue
429+
dport, proto, _, bport = m.groups()
427430
if dport == '22' and proto == 'tcp':
428431
self.port = int(bport)
429432

0 commit comments

Comments
 (0)