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.hromatka@oracle.com>
return Run.run(cmd)
- def run(self, cntnr_cmd):
+ def run(self, cntnr_cmd, shell_bool=False):
cmd = list()
if self.privileged:
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()