Skip to content

Commit

Permalink
Disable client_mode on FreeBSD platform
Browse files Browse the repository at this point in the history
  • Loading branch information
starbops committed May 8, 2023
1 parent a4c7b5f commit ef0bd7c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion oslo_privsep/priv_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ def __init__(self, prefix, cfg_section='privsep', pypath=None,
# NOTE(claudiub): oslo.privsep is not currently supported on Windows,
# as it uses Linux-specific functionality (os.fork, socker.AF_UNIX).
# The client_mode should be set to False on Windows.
self.client_mode = sys.platform != 'win32'
# NOTE(starbops): so does FreeBSD
if sys.platform == 'win32' or sys.platform.startswith('freebsd'):
self.client_mode = False
else:
self.client_mode = True

self.channel = None
self.start_lock = threading.Lock()

Expand Down Expand Up @@ -219,6 +224,10 @@ def set_client_mode(self, enabled):
raise RuntimeError(
"Enabling the client_mode is not currently "
"supported on Windows.")
elif enabled and sys.platformstartswith('freebsd'):
raise RuntimeError(
"Enabling the client_mode is not currently "
"supported on FreeBSD.")
self.client_mode = enabled

def entrypoint(self, func):
Expand Down

0 comments on commit ef0bd7c

Please sign in to comment.