forked from andsens/bootstrap-vz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
18 lines (15 loc) · 738 Bytes
/
tasks.py
File metadata and controls
18 lines (15 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from bootstrapvz.base import Task
from bootstrapvz.common import phases
from bootstrapvz.plugins.file_copy.tasks import MkdirCommand
from bootstrapvz.plugins.file_copy.tasks import FileCopyCommand
class ImageExecuteCommand(Task):
description = 'Executing commands in the image'
phase = phases.user_modification
predecessors = [MkdirCommand, FileCopyCommand]
@classmethod
def run(cls, info):
from bootstrapvz.common.tools import log_check_call
for raw_command in info.manifest.plugins['commands']['commands']:
command = map(lambda part: part.format(root=info.root, **info.manifest_vars), raw_command)
shell = len(command) == 1
log_check_call(command, shell=shell)