Closed jherland closed 3 years ago
Very nice! I'd very much like to keep python 3.6 compatibility as I know a bunch of folks who still use it.
It may not worth to run openconnect on the event loop. A traditional subprocess.run
call may suffice. This would work around the quirks of asyncio in 3.6.
Yes, AFAICS we simply run openconnect at the end, and there's no concurrency or real asynchronicity remaining at that point, so it should be fairly straightforward to "leave" async mode before then.
Superseded by https://github.com/vlaci/openconnect-sso/pull/33
You may force push to the existing branch you prepared the PR from, it automatically updates the PR itself. No need to create new pull requests in such cases.
I configure my SSH with ControlMaster connections that must be closed when I disconnect from VPN, otherwise they are left stale and existing and future SSH session are left hanging/wedged.
To accomodate this, the last patch in this series teaches openconnect-sso automatically run a configured command on VPN disconnection. In my case, I run a shell script that does
ssh -O exit ...
on my connections, although this doesn't matter from openconnect-sso's POV.Otherwise the other patches are only tangentially related:
Ctrl+C
to run anyexcept
/finally
clauses in coroutines, instead of aborting straight out of async mode intoapp.py:run()
. The patch does this by usingasyncio.run()
(new in Python v3.7). There may be a different way to achieve this that retains v3.6-compatibility, but I could not easily find it.FWIW, I also have the same series rebased onto the
develop
branch in my fork.