summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-03-29 07:20:09 +0000
committerGerrit Code Review <review@openstack.org>2022-03-29 07:20:09 +0000
commit6f7c758674b20bec78262e34aa407baac5ecde5d (patch)
tree0efb10284c3d717b1588121d3b3a88749af7a8d6
parentb0ee054cc764b0e28ee6e1b0cc1c1886ce14c2c2 (diff)
parenta190e35bb8039dad5336e658ac7947adebbb6da6 (diff)
downloadzuul-6f7c758674b20bec78262e34aa407baac5ecde5d.tar.gz
Merge "Add a note about bwrap and setsid"
-rw-r--r--zuul/driver/bubblewrap/__init__.py17
-rw-r--r--zuul/executor/server.py2
2 files changed, 7 insertions, 12 deletions
diff --git a/zuul/driver/bubblewrap/__init__.py b/zuul/driver/bubblewrap/__init__.py
index 71919eb7b..69ade4748 100644
--- a/zuul/driver/bubblewrap/__init__.py
+++ b/zuul/driver/bubblewrap/__init__.py
@@ -22,7 +22,6 @@ import os
import psutil
import pwd
import shlex
-import sys
import threading
import re
import struct
@@ -41,17 +40,11 @@ class WrappedPopen(object):
def __call__(self, args, *sub_args, **kwargs):
try:
args = self.command + args
- if kwargs.get('close_fds') or sys.version_info.major >= 3:
- # The default in py3 is close_fds=True, so we need to pass
- # our open fds in. However, this can only work right in
- # py3.2 or later due to the lack of 'pass_fds' in prior
- # versions. So until we are py3 only we can only bwrap
- # things that are close_fds=False
- pass_fds = list(kwargs.get('pass_fds', []))
- for fd in self.fds:
- if fd not in pass_fds:
- pass_fds.append(fd)
- kwargs['pass_fds'] = pass_fds
+ pass_fds = list(kwargs.get('pass_fds', []))
+ for fd in self.fds:
+ if fd not in pass_fds:
+ pass_fds.append(fd)
+ kwargs['pass_fds'] = pass_fds
proc = psutil.Popen(args, *sub_args, **kwargs)
finally:
self.__del__()
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index 59bee9ddd..158042be4 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -2829,6 +2829,8 @@ class AnsibleJob(object):
stdin=subprocess.DEVNULL,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
+ # Either this must be present, or we need the
+ # --new-session argument for bwrap.
start_new_session=True,
env=env_copy,
)