mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +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):
|
def resolve_tasks(taskset, manifest):
|
||||||
taskset.add(tasks.CheckPaths)
|
|
||||||
taskset.add(tasks.AddPackages)
|
taskset.add(tasks.AddPackages)
|
||||||
if 'assets' in manifest.plugins['puppet']:
|
if 'assets' in manifest.plugins['puppet']:
|
||||||
|
taskset.add(tasks.CheckAssetsPath)
|
||||||
taskset.add(tasks.CopyPuppetAssets)
|
taskset.add(tasks.CopyPuppetAssets)
|
||||||
if 'manifest' in manifest.plugins['puppet']:
|
if 'manifest' in manifest.plugins['puppet']:
|
||||||
|
taskset.add(tasks.CheckManifestPath)
|
||||||
taskset.add(tasks.ApplyPuppetManifest)
|
taskset.add(tasks.ApplyPuppetManifest)
|
||||||
|
|
|
@ -5,8 +5,8 @@ from common.tasks import network
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class CheckPaths(Task):
|
class CheckAssetsPath(Task):
|
||||||
description = 'Checking whether manifest and assets paths exist'
|
description = 'Checking whether the assets path exist'
|
||||||
phase = phases.preparation
|
phase = phases.preparation
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -20,6 +20,14 @@ class CheckPaths(Task):
|
||||||
msg = 'The assets path {assets} does not point to a directory.'.format(assets=assets)
|
msg = 'The assets path {assets} does not point to a directory.'.format(assets=assets)
|
||||||
raise TaskError(msg)
|
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']
|
manifest = info.manifest.plugins['puppet']['manifest']
|
||||||
if not os.path.exists(manifest):
|
if not os.path.exists(manifest):
|
||||||
msg = 'The manifest file {manifest} does not exist.'.format(manifest=manifest)
|
msg = 'The manifest file {manifest} does not exist.'.format(manifest=manifest)
|
||||||
|
|
Loading…
Add table
Reference in a new issue