2013-09-04 14:46:54 +02:00
|
|
|
from base import Task
|
|
|
|
from common import phases
|
|
|
|
|
|
|
|
|
|
|
|
class ImageExecuteCommand(Task):
|
2013-11-24 16:15:01 +01:00
|
|
|
description = 'Execute command in the image'
|
|
|
|
phase = phases.system_modification
|
2013-09-04 14:46:54 +02:00
|
|
|
|
2014-01-05 15:57:11 +01:00
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
2013-11-24 16:15:01 +01:00
|
|
|
from common.tools import log_check_call
|
2014-01-12 12:58:29 +01:00
|
|
|
for raw_command in info.manifest.plugins['image_commands']['commands']:
|
2014-01-14 08:46:53 +01:00
|
|
|
command = map(lambda part: part.format(root=info.root, **info.manifest_vars), raw_command)
|
2013-11-24 16:15:01 +01:00
|
|
|
log_check_call(command)
|