Update all .py source files by
$ pyupgrade --py3-only $(git ls-files | grep ".py$")
to modernize the code according to Python 3 syntaxes.
Also add the pyupgrade hook to pre-commit to avoid merging additional
Python 2 syntaxes.
Change-Id: Ic65f3ab3bd46678c9b604516bc5c99458207a2ff
When a context's 'capabilities' property was a non-empty list,
Daemon.run() would try to manipulate Linux capabilities, and fail if the
original user didn't already have (at least) these capabilities. This
is appropriate for the regular use case, but the intention of
UnprivilegedPrivsepFixture is that it would be a no-op that works for
zero-privilege test environments.
This change clears the capabilities list (setting/expecting zero
privileges) in UnprivilegedPrivsepFixture, as was originally intended.
Change-Id: I8a0d8275877a1f9e139127049b7e234003f901ea
Supports starting privileged process via fork or sudo, and a thread-safe
client and server communication mechanism.
Coming in later changes:
- Extend json encoding to deal with non-unicode and more varied dict
keys (see test_comm.py).
- eventlet test case.
- Linux capabilities.
Change-Id: If6456631c51d4f2a1c95805ab9d6962b04f172bc
Implements: blueprint privsep