27 lines
707 B
Python
27 lines
707 B
Python
|
#! /usr/bin/env python
|
||
|
# -*- coding: UTF-8 -*-
|
||
|
"""
|
||
|
Test des patches pour diagnose
|
||
|
réutilisation du code de zephir-client
|
||
|
"""
|
||
|
import sys
|
||
|
from glob import glob
|
||
|
from os.path import basename
|
||
|
from creole import utils
|
||
|
from creole.config import patch_dir
|
||
|
from zephir.monitor.agents import patches
|
||
|
from os.path import join
|
||
|
|
||
|
patchs = glob(join(patch_dir, '*.patch'))
|
||
|
patchs.extend(glob(join(patch_dir, 'variante', '*.patch')))
|
||
|
err = []
|
||
|
for patch in patchs:
|
||
|
verif = patches.verify_patch(patch).values()
|
||
|
if len(verif) > 0 and len(verif[0]) > 0:
|
||
|
err.append(basename(patch))
|
||
|
if len(err) != 0:
|
||
|
utils.print_red('Erreur')
|
||
|
print "fichiers : %s" % (", ".join(err),)
|
||
|
else:
|
||
|
utils.print_green('Ok')
|