2014-03-23 23:12:07 +01:00
|
|
|
from bootstrapvz.base import Task
|
|
|
|
from bootstrapvz.common import phases
|
2013-09-04 14:46:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ImageExecuteCommand(Task):
|
2015-05-02 12:29:55 +02:00
|
|
|
description = 'Executing commands in the image'
|
|
|
|
phase = phases.user_modification
|
2013-09-04 14:46:54 +02:00
|
|
|
|
2014-01-05 15:57:11 +01:00
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
2014-03-23 23:12:07 +01:00
|
|
|
from bootstrapvz.common.tools import log_check_call
|
2015-05-02 12:36:14 +02:00
|
|
|
for raw_command in info.manifest.plugins['commands']['commands']:
|
2014-01-14 08:46:53 +01:00
|
|
|
command = map(lambda part: part.format(root=info.root, **info.manifest_vars), raw_command)
|
2015-03-27 11:23:58 -03:00
|
|
|
shell = len(command) == 1
|
|
|
|
log_check_call(command, shell=shell)
|