Fix retrying when finding an available port for a Perforce stunnel.

Review Request #10942 — Created March 9, 2020 and submitted

chipx86
Review Board
release-3.0.x
reviewboard

When setting up stunnel for Perforce, we try to find an available local
port we can open for the local end of the tunnel. The intent of the
logic here was to keep trying until we've found some port, retrying any
time we hit an error trying to open one (usually a result of the port
already being opened).

The logic was flawed. We had the try/finally, but no except, meaning
that the first failure would bubble up out of the function. Retrying
never actually occurred.

This change fixes that, adding an empty except that just lets us
continue again. It also fixes up some bare except: lines, just to
satisfy linters.

Unit tests passed.

Summary
Fix retrying when finding an available port for a Perforce stunnel.
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (1f3ad0c)
Loading...