[/etc/crans/services] Extraction d'informations pour generate

This commit is contained in:
Valentin Samir 2013-07-06 21:51:16 +02:00
parent 67eec5f7a9
commit ba7c942899
2 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,4 @@
<Bundle name="generate"> <Bundle name="generate">
<Python name="/etc/cron.d/generate"/> <Python name="/etc/cron.d/generate"/>
<Python name="/etc/crans/services.py"/>
</Bundle> </Bundle>

View file

@ -0,0 +1,20 @@
# -*- mode: python; encoding: utf-8 -*-
info["owner"] = "root"
info["group"] = "root"
info["perms"] = 0644
comment_start = "#"
header("Services configuré sur la machine")
#print metadata.query.names_by_groups(['firewall'])
print "services = {"
groups = list(metadata.groups)
groups.sort()
for group in groups:
names = [ name.split('.', 1)[0] for name in metadata.query.names_by_groups([group])]
names.sort()
print " '%s':%s," % (group, names)
print "}"