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
|
{% python
|
||||||
import os
|
execfile('/etc/crans/secrets/secrets.py')
|
||||||
os.sys.append('/usr/script/gestion')
|
%}\
|
||||||
import secrets
|
|
||||||
%}
|
|
||||||
|
|
|
@ -31,6 +31,9 @@ pubhostname = hostname + ".crans.org"
|
||||||
# Le nom d'hote sur le vlan
|
# Le nom d'hote sur le vlan
|
||||||
admhostname = hostname + ".adm.crans.org"
|
admhostname = hostname + ".adm.crans.org"
|
||||||
|
|
||||||
|
def has(group):
|
||||||
|
return group in metadata.groups
|
||||||
|
|
||||||
def yesno(b):
|
def yesno(b):
|
||||||
if b:
|
if b:
|
||||||
return "yes"
|
return "yes"
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
{# Definitions utiles pour les templates #}\
|
{# Definitions utiles pour les templates #}\
|
||||||
{% python
|
{% python
|
||||||
import os
|
execfile('/var/lib/bcfg2/etc/genshi/utils.py')
|
||||||
os.sys.path.append('/var/lib/bcfg2/etc/genshi')
|
|
||||||
from utils import *
|
|
||||||
|
|
||||||
def has(group):
|
|
||||||
return group in metadata.groups
|
|
||||||
%}\
|
%}\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue