mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
fix call of ImageCommands, object should not be called, only class should be
remove loopback_file reference, not existing anymore filesystem not available anymore, and depends on volume layout so remove the execute commands after the user_packages install, else user won't be able to call or update installed packages
This commit is contained in:
parent
d35b131c8f
commit
99b7834611
3 changed files with 8 additions and 13 deletions
|
@ -14,11 +14,9 @@ Command is executed in current context. It is possible to use variables to acces
|
||||||
|
|
||||||
Available variables are:
|
Available variables are:
|
||||||
{root} : image mount point (to copy files for example or chroot commands)
|
{root} : image mount point (to copy files for example or chroot commands)
|
||||||
{filesystem} : used filesystem
|
|
||||||
{image} : image file path
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
[[ "touch", "{root}/var/www/hello" ],
|
[[ "touch", "{root}/var/www/hello" ],
|
||||||
[ "/usr/sbin/chroot", "{root}", "touch", "/var/www/hello.{filesystem}"]]
|
[ "/usr/sbin/chroot", "{root}", "touch", "/var/www/hello"]]
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
def tasks(tasklist, manifest):
|
def tasks(tasklist, manifest):
|
||||||
from image_commands import ImageExecuteCommand
|
from image_commands import ImageExecuteCommand
|
||||||
tasklist.add(ImageExecuteCommand())
|
tasklist.add(ImageExecuteCommand)
|
||||||
|
|
||||||
|
|
||||||
def validate_manifest(data, schema_validate):
|
def validate_manifest(data, schema_validate):
|
||||||
from os import path
|
from os import path
|
||||||
schema_path = path.normpath(path.join(path.dirname(__file__), 'manifest-schema.json'))
|
schema_path = path.normpath(path.join(path.dirname(__file__), 'manifest-schema.json'))
|
||||||
schema_validate(data, schema_path)
|
schema_validate(data, schema_path)
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
from base import Task
|
from base import Task
|
||||||
from common import phases
|
from common import phases
|
||||||
|
from plugins.user_packages.user_packages import AddUserPackages, \
|
||||||
|
AddLocalUserPackages
|
||||||
|
|
||||||
|
|
||||||
class ImageExecuteCommand(Task):
|
class ImageExecuteCommand(Task):
|
||||||
description = 'Execute command in the image'
|
description = 'Execute command in the image'
|
||||||
phase = phases.system_modification
|
phase = phases.system_modification
|
||||||
|
predecessors = [AddUserPackages, AddLocalUserPackages]
|
||||||
|
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
from common.tools import log_check_call
|
from common.tools import log_check_call
|
||||||
|
|
||||||
for user_cmd in info.manifest.plugins['image_commands']['commands']:
|
for user_cmd in info.manifest.plugins['image_commands']['commands']:
|
||||||
command = []
|
command = []
|
||||||
for elt in user_cmd:
|
for elt in user_cmd:
|
||||||
fragment = elt.format(
|
fragment = elt.format(root=info.root)
|
||||||
root=info.root,
|
command.append(fragment)
|
||||||
image=info.loopback_file,
|
|
||||||
filesystem=info.manifest.volume['filesystem'])
|
|
||||||
command.append(fragment)
|
|
||||||
log_check_call(command)
|
log_check_call(command)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue