mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Merge remote-tracking branch 'osallou/update_image_commands_to_base' into python
Conflicts: plugins/image_commands/__init__.py plugins/image_commands/image_commands.py
This commit is contained in:
commit
4cca325fb4
2 changed files with 4 additions and 6 deletions
|
@ -14,11 +14,9 @@ Command is executed in current context. It is possible to use variables to acces
|
|||
|
||||
Available variables are:
|
||||
{root} : image mount point (to copy files for example or chroot commands)
|
||||
{filesystem} : used filesystem
|
||||
{image} : image file path
|
||||
|
||||
Example:
|
||||
|
||||
[[ "touch", "{root}/var/www/hello" ],
|
||||
[ "/usr/sbin/chroot", "{root}", "touch", "/var/www/hello.{filesystem}"]]
|
||||
[ "/usr/sbin/chroot", "{root}", "touch", "/var/www/hello"]]
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
from base import Task
|
||||
from common import phases
|
||||
from plugins.packages import tasks as packages
|
||||
|
||||
|
||||
class ImageExecuteCommand(Task):
|
||||
description = 'Execute command in the image'
|
||||
phase = phases.system_modification
|
||||
predecessors = [packages.AddUserPackages, packages.AddLocalUserPackages]
|
||||
|
||||
def run(self, info):
|
||||
from common.tools import log_check_call
|
||||
|
@ -12,8 +14,6 @@ class ImageExecuteCommand(Task):
|
|||
for user_cmd in info.manifest.plugins['image_commands']['commands']:
|
||||
command = []
|
||||
for elt in user_cmd:
|
||||
fragment = elt.format(root=info.root,
|
||||
image=info.loopback_file,
|
||||
filesystem=info.manifest.volume['filesystem'])
|
||||
fragment = elt.format(root=info.root)
|
||||
command.append(fragment)
|
||||
log_check_call(command)
|
||||
|
|
Loading…
Add table
Reference in a new issue