diff --git a/action_plugins/postconf.py b/action_plugins/postconf.py index 5a7b9dd..ec92ff4 100755 --- a/action_plugins/postconf.py +++ b/action_plugins/postconf.py @@ -43,28 +43,31 @@ class ActionModule(ActionBase): return '{}'.format(self._task.args.get(key, '')) if key in ('private', 'unprivileged', 'chroot', 'wakeup', 'process_limit'): return '{}'.format(self._task.args.get(key, '')) + if key == 'container_name': + return '{}'.format(self._task.args.get(key, 'postfix')) # no default value for key: return as-is return self._task.args.get(key) def runcmd(self, reg_name, cmd, param=None): + fullcmd = 'docker exec '+ self.getarg('container_name') + cmd try: if param: self.reg[param][reg_name] = self._execute_module( module_name='command', - module_args=dict(_raw_params=cmd) + module_args=dict(_raw_params=fullcmd) ) return self.reg[reg_name] = self._execute_module( module_name='command', - module_args=dict(_raw_params=cmd) + module_args=dict(_raw_params=fullcmd) ) except Exception as e: raise PfWorkflowError( "{}: {}; failed command line: {}".format( type(e).__name__, to_text(e), - cmd + fullcmd ) )