Execfile plutot que import
On utilise execfile pour avoir acces a l'environmement, notamment a metadata. darcs-hash:20071209024939-af139-376cff9921a7abca0f1d05e101fa21f6be9bee91.gz
This commit is contained in:
parent
f49bdaa08c
commit
c54f2669d8
3 changed files with 7 additions and 11 deletions
|
@ -1,6 +1,4 @@
|
|||
{# Recuperation des mots de passe #}
|
||||
{# Recuperation des mots de passe #}\
|
||||
{% python
|
||||
import os
|
||||
os.sys.append('/usr/script/gestion')
|
||||
import secrets
|
||||
%}
|
||||
execfile('/etc/crans/secrets/secrets.py')
|
||||
%}\
|
||||
|
|
|
@ -31,6 +31,9 @@ pubhostname = hostname + ".crans.org"
|
|||
# Le nom d'hote sur le vlan
|
||||
admhostname = hostname + ".adm.crans.org"
|
||||
|
||||
def has(group):
|
||||
return group in metadata.groups
|
||||
|
||||
def yesno(b):
|
||||
if b:
|
||||
return "yes"
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{# Definitions utiles pour les templates #}\
|
||||
{% python
|
||||
import os
|
||||
os.sys.path.append('/var/lib/bcfg2/etc/genshi')
|
||||
from utils import *
|
||||
|
||||
def has(group):
|
||||
return group in metadata.groups
|
||||
execfile('/var/lib/bcfg2/etc/genshi/utils.py')
|
||||
%}\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue