diff options
author | Clint Byrum <clint@fewbar.com> | 2017-04-04 16:20:00 -0700 |
---|---|---|
committer | James E. Blair <jeblair@redhat.com> | 2017-06-01 09:26:45 -0700 |
commit | 5870ccae62a3a7d38604b4a2f5b87d84aeafaee0 (patch) | |
tree | 63062c67fd39789af989eb6e0bf48cc41be9c4ff /zuul/driver/__init__.py | |
parent | 50c69d895796264891e87c96c091b31ca9e4eec2 (diff) | |
download | zuul-5870ccae62a3a7d38604b4a2f5b87d84aeafaee0.tar.gz |
Add support for bwrap
This will be the minimum "batteries included" bubblwrap driver. It does
not do any MAC configuration, since these vary by system. Operators
may wish to wrap it further in a MAC wrapper driver.
Because we set bubblewrap as the default wrapper, test_playbooks tests
it. However, it lacks a negative test, so we won't know if we're not
actually containing things.
Users who don't have bubblewrap or don't wish to use it can set the
untrusted_wrapper to 'nullwrap' which will just execute things as
they're done before this change.
Change-Id: I84dd7c8cc55d2110b58609784007ffda0d135716
Story: 2000910
Task: 3540
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Diffstat (limited to 'zuul/driver/__init__.py')
-rw-r--r-- | zuul/driver/__init__.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/zuul/driver/__init__.py b/zuul/driver/__init__.py index 671996ac3..0c3105d1b 100644 --- a/zuul/driver/__init__.py +++ b/zuul/driver/__init__.py @@ -254,3 +254,27 @@ class ReporterInterface(object): """ pass + + +@six.add_metaclass(abc.ABCMeta) +class WrapperInterface(object): + """The wrapper interface to be implmeneted by a driver. + + A driver which wraps execution of commands executed by Zuul should + implement this interface. + + """ + + @abc.abstractmethod + def getPopen(self, **kwargs): + """Create and return a subprocess.Popen factory wrapped however the + driver sees fit. + + This method is required by the interface + + :arg dict kwargs: key/values for use by driver as needed + + :returns: a callable that takes the same args as subprocess.Popen + :rtype: Callable + """ + pass |