4 Commits

Author SHA1 Message Date
Takashi Kajinami
d664c17409 Run pyupgrade to clean up Python 2 syntaxes
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
2024-10-21 20:01:00 +09:00
Angus Lees
539ff4e4e0 UnprivilegedPrivsepFixture: Clear capabilities config
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
2016-02-10 14:59:40 +11:00
Zhihai Song
6c1a6f58b6 Use logging intead of oslo_log
We should make dependency of a oslo lib on other oslo libs as
little as possible.

Change-Id: I4ccb3d416842b06b6bd93d588f75b85fdf48204d
2016-01-04 16:05:43 +08:00
Angus Lees
025dd2476f Initial basic privsep functionality
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
2015-11-09 11:15:43 +11:00