mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
Split up CheckPaths task in puppet plugin
This commit is contained in:
parent
c4794ce9f3
commit
b692532d90
2 changed files with 12 additions and 3 deletions
|
@ -8,9 +8,10 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
taskset.add(tasks.CheckPaths)
|
||||
taskset.add(tasks.AddPackages)
|
||||
if 'assets' in manifest.plugins['puppet']:
|
||||
taskset.add(tasks.CheckAssetsPath)
|
||||
taskset.add(tasks.CopyPuppetAssets)
|
||||
if 'manifest' in manifest.plugins['puppet']:
|
||||
taskset.add(tasks.CheckManifestPath)
|
||||
taskset.add(tasks.ApplyPuppetManifest)
|
||||
|
|
|
@ -5,8 +5,8 @@ from common.tasks import network
|
|||
import os
|
||||
|
||||
|
||||
class CheckPaths(Task):
|
||||
description = 'Checking whether manifest and assets paths exist'
|
||||
class CheckAssetsPath(Task):
|
||||
description = 'Checking whether the assets path exist'
|
||||
phase = phases.preparation
|
||||
|
||||
@classmethod
|
||||
|
@ -20,6 +20,14 @@ class CheckPaths(Task):
|
|||
msg = 'The assets path {assets} does not point to a directory.'.format(assets=assets)
|
||||
raise TaskError(msg)
|
||||
|
||||
|
||||
class CheckManifestPath(Task):
|
||||
description = 'Checking whether the manifest path exist'
|
||||
phase = phases.preparation
|
||||
|
||||
@classmethod
|
||||
def run(cls, info):
|
||||
from common.exceptions import TaskError
|
||||
manifest = info.manifest.plugins['puppet']['manifest']
|
||||
if not os.path.exists(manifest):
|
||||
msg = 'The manifest file {manifest} does not exist.'.format(manifest=manifest)
|
||||
|
|
Loading…
Add table
Reference in a new issue