mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Merge pull request #205 from jwendell/exec_shell
Execute entries with a single string as shell commands
This commit is contained in:
commit
441503fedf
2 changed files with 8 additions and 1 deletions
|
@ -10,6 +10,12 @@ Plugin is defined in the manifest file, plugin section with:
|
|||
|
||||
The *commands* element is an array of commands. Each command is an array describing the executable and its arguments.
|
||||
|
||||
If you need shell expansion of wildcards, like __\*__, just put the entire command as a single entry:
|
||||
|
||||
"image_commands": {
|
||||
"commands": [ [ "rm -f /tmp/*" ]],
|
||||
}
|
||||
|
||||
Command is executed in current context. It is possible to use variables to access the image or execute chroot commands in the image.
|
||||
|
||||
Available variables are:
|
||||
|
|
|
@ -11,4 +11,5 @@ class ImageExecuteCommand(Task):
|
|||
from bootstrapvz.common.tools import log_check_call
|
||||
for raw_command in info.manifest.plugins['image_commands']['commands']:
|
||||
command = map(lambda part: part.format(root=info.root, **info.manifest_vars), raw_command)
|
||||
log_check_call(command)
|
||||
shell = len(command) == 1
|
||||
log_check_call(command, shell=shell)
|
||||
|
|
Loading…
Add table
Reference in a new issue