Add support for shell commands to Container.run() method.
The parameter, shell_bool, is passed directly to Run.run()
and is ultimately sent on to subprocess.Popen().  As the
name implies, when shell_bool is set to true, the requested
command will be executed through the shell.

Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com>
---
 ftests/container.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ftests/container.py b/ftests/container.py
index 948018e63ce3..8fc468d05a50 100644
--- a/ftests/container.py
+++ b/ftests/container.py
@@ -126,7 +126,7 @@ class Container(object):
 
         return Run.run(cmd)
 
-    def run(self, cntnr_cmd):
+    def run(self, cntnr_cmd, shell_bool=False):
         cmd = list()
 
         if self.privileged:
@@ -148,7 +148,7 @@ class Container(object):
         else:
             raise ContainerError('Unsupported command type')
 
-        return Run.run(cmd).decode('ascii')
+        return Run.run(cmd, shell_bool=shell_bool).decode('ascii')
 
     def start(self):
         cmd = list()
-- 
2.25.4



_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to