Ajout de l'attribut __slots__ aux classes pour économiser de la ram
This commit is contained in:
parent
61bf832112
commit
d8bac8d47e
5 changed files with 174 additions and 47 deletions
103
attributs.py
103
attributs.py
|
@ -196,6 +196,7 @@ class AttrsList(list):
|
||||||
self._commit()
|
self._commit()
|
||||||
|
|
||||||
class AttrsDict(dict):
|
class AttrsDict(dict):
|
||||||
|
__slots__ = ("_conn", "_parent", "_iterator")
|
||||||
def __init__(self, conn, uldif={}, Parent=None):
|
def __init__(self, conn, uldif={}, Parent=None):
|
||||||
super(AttrsDict, self).__init__(uldif)
|
super(AttrsDict, self).__init__(uldif)
|
||||||
self._conn = conn
|
self._conn = conn
|
||||||
|
@ -250,10 +251,10 @@ class Attr(object):
|
||||||
* ``val`` : valeur de l'attribut
|
* ``val`` : valeur de l'attribut
|
||||||
* ``ldif`` : objet contenant l'attribut (permet de faire les validations sur l'environnement)
|
* ``ldif`` : objet contenant l'attribut (permet de faire les validations sur l'environnement)
|
||||||
"""
|
"""
|
||||||
|
__slots__ = ("value", "conn", "parent")
|
||||||
legend = "Human-readable description of attribute"
|
legend = "Human-readable description of attribute"
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
conn = None
|
|
||||||
unique = False
|
unique = False
|
||||||
concurrent = True
|
concurrent = True
|
||||||
historique = "full" # valeurs possibles "full", "partial", "info", None
|
historique = "full" # valeurs possibles "full", "partial", "info", None
|
||||||
|
@ -386,6 +387,7 @@ def crans_attribute(classe):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class objectClass(Attr):
|
class objectClass(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = False
|
optional = False
|
||||||
legend = "entité"
|
legend = "entité"
|
||||||
|
@ -408,7 +410,7 @@ class objectClass(Attr):
|
||||||
|
|
||||||
|
|
||||||
class intAttr(Attr):
|
class intAttr(Attr):
|
||||||
|
__slots__ = ()
|
||||||
python_type = int
|
python_type = int
|
||||||
|
|
||||||
def __add__(self, obj):
|
def __add__(self, obj):
|
||||||
|
@ -432,7 +434,7 @@ class intAttr(Attr):
|
||||||
return unicode(self.value)
|
return unicode(self.value)
|
||||||
|
|
||||||
class floatAttr(Attr):
|
class floatAttr(Attr):
|
||||||
|
__slots__ = ()
|
||||||
python_type = float
|
python_type = float
|
||||||
|
|
||||||
def __add__(self, obj):
|
def __add__(self, obj):
|
||||||
|
@ -454,7 +456,7 @@ class floatAttr(Attr):
|
||||||
return unicode(self.value)
|
return unicode(self.value)
|
||||||
|
|
||||||
class boolAttr(Attr):
|
class boolAttr(Attr):
|
||||||
|
__slots__ = ()
|
||||||
python_type = bool
|
python_type = bool
|
||||||
|
|
||||||
def parse_value(self, val):
|
def parse_value(self, val):
|
||||||
|
@ -472,6 +474,7 @@ class boolAttr(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class aid(intAttr):
|
class aid(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Identifiant de l'adhérent"
|
legend = u"Identifiant de l'adhérent"
|
||||||
|
@ -489,6 +492,7 @@ class aid(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class uid(Attr):
|
class uid(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
option = False
|
option = False
|
||||||
legend = u"L'identifiant canonique de l'adhérent"
|
legend = u"L'identifiant canonique de l'adhérent"
|
||||||
|
@ -499,6 +503,7 @@ class uid(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class preferedLanguage(Attr):
|
class preferedLanguage(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
option = True
|
option = True
|
||||||
legend = u"La langue préférée de l'adhérent"
|
legend = u"La langue préférée de l'adhérent"
|
||||||
|
@ -508,6 +513,7 @@ class preferedLanguage(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class nom(Attr):
|
class nom(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = False
|
optional = False
|
||||||
legend = "Nom"
|
legend = "Nom"
|
||||||
|
@ -526,6 +532,7 @@ class nom(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class prenom(Attr):
|
class prenom(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = False
|
optional = False
|
||||||
legend = u"Prénom"
|
legend = u"Prénom"
|
||||||
|
@ -538,6 +545,7 @@ class prenom(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class compteWiki(Attr):
|
class compteWiki(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Compte WiKi"
|
legend = u"Compte WiKi"
|
||||||
|
@ -551,6 +559,7 @@ class compteWiki(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class tel(Attr):
|
class tel(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = False
|
optional = False
|
||||||
legend = u"Téléphone"
|
legend = u"Téléphone"
|
||||||
|
@ -564,6 +573,7 @@ class tel(Attr):
|
||||||
raise ValueError("Numéro de téléphone invalide (%r)" % tel)
|
raise ValueError("Numéro de téléphone invalide (%r)" % tel)
|
||||||
|
|
||||||
class yearAttr(intAttr):
|
class yearAttr(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
|
|
||||||
|
@ -575,6 +585,7 @@ class yearAttr(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class paiement(yearAttr):
|
class paiement(yearAttr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Paiement"
|
legend = u"Paiement"
|
||||||
can_modify = [cableur, nounou, tresorier]
|
can_modify = [cableur, nounou, tresorier]
|
||||||
category = 'perso'
|
category = 'perso'
|
||||||
|
@ -582,6 +593,7 @@ class paiement(yearAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class carteEtudiant(Attr):
|
class carteEtudiant(Attr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Carte d'étudiant"
|
legend = u"Carte d'étudiant"
|
||||||
category = 'perso'
|
category = 'perso'
|
||||||
can_modify = [cableur, nounou, tresorier]
|
can_modify = [cableur, nounou, tresorier]
|
||||||
|
@ -592,6 +604,7 @@ class carteEtudiant(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class derniereConnexion(intAttr):
|
class derniereConnexion(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Dernière connexion"
|
legend = u"Dernière connexion"
|
||||||
can_modify = [nounou, cableur, soi] # il faut bien pouvoir le modifier pour le mettre à jour
|
can_modify = [nounou, cableur, soi] # il faut bien pouvoir le modifier pour le mettre à jour
|
||||||
ldap_name = "derniereConnexion"
|
ldap_name = "derniereConnexion"
|
||||||
|
@ -601,6 +614,7 @@ class generalizedTimeFormat(Attr):
|
||||||
une donnée de temps suivant la RFC 4517
|
une donnée de temps suivant la RFC 4517
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
__slots__ = ("_stamp",)
|
||||||
default = "19700101000000Z"
|
default = "19700101000000Z"
|
||||||
|
|
||||||
def __float__(self):
|
def __float__(self):
|
||||||
|
@ -649,6 +663,7 @@ class generalizedTimeFormat(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class debutAdhesion(generalizedTimeFormat):
|
class debutAdhesion(generalizedTimeFormat):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Date de début de l'adhésion"
|
legend = u"Date de début de l'adhésion"
|
||||||
category = 'Adh'
|
category = 'Adh'
|
||||||
can_modify = [cableur, nounou]
|
can_modify = [cableur, nounou]
|
||||||
|
@ -657,6 +672,7 @@ class debutAdhesion(generalizedTimeFormat):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class finAdhesion(generalizedTimeFormat):
|
class finAdhesion(generalizedTimeFormat):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Date de fin de l'adhésion"
|
legend = u"Date de fin de l'adhésion"
|
||||||
category = 'Adh'
|
category = 'Adh'
|
||||||
can_modify = [cableur, nounou]
|
can_modify = [cableur, nounou]
|
||||||
|
@ -664,6 +680,7 @@ class finAdhesion(generalizedTimeFormat):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class debutConnexion(generalizedTimeFormat):
|
class debutConnexion(generalizedTimeFormat):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Date de début de la connexion"
|
legend = u"Date de début de la connexion"
|
||||||
category = 'Adh'
|
category = 'Adh'
|
||||||
can_modify = [cableur, nounou]
|
can_modify = [cableur, nounou]
|
||||||
|
@ -671,6 +688,7 @@ class debutConnexion(generalizedTimeFormat):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class finConnexion(generalizedTimeFormat):
|
class finConnexion(generalizedTimeFormat):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Date de fin de la connexion"
|
legend = u"Date de fin de la connexion"
|
||||||
category = 'Adh'
|
category = 'Adh'
|
||||||
can_modify = [cableur, nounou]
|
can_modify = [cableur, nounou]
|
||||||
|
@ -678,6 +696,7 @@ class finConnexion(generalizedTimeFormat):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class mail(Attr):
|
class mail(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = False
|
optional = False
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -733,6 +752,7 @@ class mail(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class canonicalAlias(mail):
|
class canonicalAlias(mail):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -747,6 +767,7 @@ class canonicalAlias(mail):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class mailAlias(mail):
|
class mailAlias(mail):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -757,6 +778,7 @@ class mailAlias(mail):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class mailExt(mail):
|
class mailExt(mail):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -774,6 +796,7 @@ class mailExt(mail):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class mailInvalide(boolAttr):
|
class mailInvalide(boolAttr):
|
||||||
|
__slots__ = ()
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Mail invalide"
|
legend = u"Mail invalide"
|
||||||
can_modify = [bureau, nounou]
|
can_modify = [bureau, nounou]
|
||||||
|
@ -781,6 +804,7 @@ class mailInvalide(boolAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class contourneGreylist(boolAttr):
|
class contourneGreylist(boolAttr):
|
||||||
|
__slots__ = ()
|
||||||
optionnal = True
|
optionnal = True
|
||||||
legend = u"Contourner la greylist"
|
legend = u"Contourner la greylist"
|
||||||
category = 'mail'
|
category = 'mail'
|
||||||
|
@ -792,6 +816,7 @@ class contourneGreylist(boolAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class etudes(Attr):
|
class etudes(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Études"
|
legend = u"Études"
|
||||||
|
@ -801,6 +826,7 @@ class etudes(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class chbre(Attr):
|
class chbre(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = False
|
optional = False
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -824,6 +850,7 @@ class chbre(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class droits(Attr):
|
class droits(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Droits sur les serveurs"
|
legend = u"Droits sur les serveurs"
|
||||||
|
@ -851,6 +878,7 @@ class droits(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class solde(floatAttr):
|
class solde(floatAttr):
|
||||||
|
__slots__ = ()
|
||||||
python_type = float
|
python_type = float
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
concurrent = False
|
concurrent = False
|
||||||
|
@ -869,6 +897,7 @@ class solde(floatAttr):
|
||||||
return u"%.2f" % self.value
|
return u"%.2f" % self.value
|
||||||
|
|
||||||
class dnsAttr(Attr):
|
class dnsAttr(Attr):
|
||||||
|
__slots__ = ()
|
||||||
category = 'dns'
|
category = 'dns'
|
||||||
ldap_name = "dnsAttr"
|
ldap_name = "dnsAttr"
|
||||||
python_type = unicode
|
python_type = unicode
|
||||||
|
@ -883,6 +912,7 @@ class dnsAttr(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class host(dnsAttr):
|
class host(dnsAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
unique = True
|
unique = True
|
||||||
optional = False
|
optional = False
|
||||||
|
@ -902,6 +932,7 @@ class host(dnsAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class hostAlias(host):
|
class hostAlias(host):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
unique = True
|
unique = True
|
||||||
optional = True
|
optional = True
|
||||||
|
@ -911,6 +942,7 @@ class hostAlias(host):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class macAddress(Attr):
|
class macAddress(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = False
|
optional = False
|
||||||
legend = u"Adresse physique de la carte réseau"
|
legend = u"Adresse physique de la carte réseau"
|
||||||
|
@ -933,6 +965,7 @@ class macAddress(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class ipHostNumber(Attr):
|
class ipHostNumber(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -954,6 +987,7 @@ class ipHostNumber(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class ip6HostNumber(Attr):
|
class ip6HostNumber(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -977,6 +1011,7 @@ class ip6HostNumber(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class mid(intAttr):
|
class mid(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = False
|
optional = False
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -986,6 +1021,7 @@ class mid(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class rid(intAttr):
|
class rid(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -1017,6 +1053,7 @@ class rid(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class ipsec(Attr):
|
class ipsec(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
legend = u'Clef wifi'
|
legend = u'Clef wifi'
|
||||||
|
@ -1036,6 +1073,7 @@ class ipsec(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class puissance(Attr):
|
class puissance(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"puissance d'émission pour les bornes wifi"
|
legend = u"puissance d'émission pour les bornes wifi"
|
||||||
|
@ -1045,6 +1083,7 @@ class puissance(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class canal(intAttr):
|
class canal(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = u'Canal d\'émission de la borne'
|
legend = u'Canal d\'émission de la borne'
|
||||||
|
@ -1054,6 +1093,7 @@ class canal(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class hotspot(boolAttr):
|
class hotspot(boolAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = u'Hotspot'
|
legend = u'Hotspot'
|
||||||
|
@ -1063,6 +1103,7 @@ class hotspot(boolAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class positionBorne(Attr):
|
class positionBorne(Attr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Position de la borne"
|
legend = u"Position de la borne"
|
||||||
category = "wifi"
|
category = "wifi"
|
||||||
can_modify = [nounou]
|
can_modify = [nounou]
|
||||||
|
@ -1072,12 +1113,14 @@ class positionBorne(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class nvram(Attr):
|
class nvram(Attr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Configuration speciale"
|
legend = u"Configuration speciale"
|
||||||
optional = True
|
optional = True
|
||||||
can_modify = [nounou]
|
can_modify = [nounou]
|
||||||
ldap_name = "nvram"
|
ldap_name = "nvram"
|
||||||
|
|
||||||
class portAttr(Attr):
|
class portAttr(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
legend = u'Ouverture de port'
|
legend = u'Ouverture de port'
|
||||||
|
@ -1114,26 +1157,31 @@ class portAttr(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class portTCPout(portAttr):
|
class portTCPout(portAttr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Port TCP ouvert vers l'extérieur"
|
legend = u"Port TCP ouvert vers l'extérieur"
|
||||||
ldap_name = "portTCPout"
|
ldap_name = "portTCPout"
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class portTCPin(portAttr):
|
class portTCPin(portAttr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Port TCP ouvert depuis l'extérieur"
|
legend = u"Port TCP ouvert depuis l'extérieur"
|
||||||
ldap_name = "portTCPin"
|
ldap_name = "portTCPin"
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class portUDPout(portAttr):
|
class portUDPout(portAttr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Port UDP ouvert vers l'extérieur"
|
legend = u"Port UDP ouvert vers l'extérieur"
|
||||||
ldap_name = "portUDPout"
|
ldap_name = "portUDPout"
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class portUDPin(portAttr):
|
class portUDPin(portAttr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Port UDP ouvert depuis l'extérieur"
|
legend = u"Port UDP ouvert depuis l'extérieur"
|
||||||
ldap_name = "portUDPin"
|
ldap_name = "portUDPin"
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class exempt(Attr):
|
class exempt(Attr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Exemption vers une IP"
|
legend = u"Exemption vers une IP"
|
||||||
ldap_name = "exempt"
|
ldap_name = "exempt"
|
||||||
python_type = netaddr.IPNetwork
|
python_type = netaddr.IPNetwork
|
||||||
|
@ -1147,6 +1195,7 @@ class exempt(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class nombrePrises(intAttr):
|
class nombrePrises(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Nombre de prises ethernet de la machine"
|
legend = u"Nombre de prises ethernet de la machine"
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
|
@ -1156,6 +1205,7 @@ class nombrePrises(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class prise(Attr):
|
class prise(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Prise sur laquelle est branchée la machine"
|
legend = u"Prise sur laquelle est branchée la machine"
|
||||||
|
@ -1165,6 +1215,7 @@ class prise(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class cid(intAttr):
|
class cid(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -1177,6 +1228,7 @@ class cid(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class responsable(Attr):
|
class responsable(Attr):
|
||||||
|
__slots__ = ('__value', '_value')
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Responsable du club"
|
legend = u"Responsable du club"
|
||||||
|
@ -1222,6 +1274,7 @@ class responsable(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class imprimeurClub(Attr):
|
class imprimeurClub(Attr):
|
||||||
|
__slots__ = ("__value", "_value")
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Imprimeur du club"
|
legend = u"Imprimeur du club"
|
||||||
category = "perso"
|
category = "perso"
|
||||||
|
@ -1262,6 +1315,7 @@ class imprimeurClub(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class blacklist(Attr):
|
class blacklist(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Blackliste"
|
legend = u"Blackliste"
|
||||||
|
@ -1314,7 +1368,7 @@ class blacklist(Attr):
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class historique(Attr):
|
class historique(Attr):
|
||||||
"""Un historique est usuellement de la forme JJ/MM/AAAA HH:mm:ss, action comm"""
|
"""Un historique est usuellement de la forme JJ/MM/AAAA HH:mm:ss, action comm"""
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
concurrent = False
|
concurrent = False
|
||||||
optional = True
|
optional = True
|
||||||
|
@ -1339,6 +1393,7 @@ class historique(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class info(Attr):
|
class info(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Quelques informations"
|
legend = u"Quelques informations"
|
||||||
|
@ -1349,6 +1404,7 @@ class info(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class homepageAlias(Attr):
|
class homepageAlias(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = u'Un alias pour la page personnelle'
|
legend = u'Un alias pour la page personnelle'
|
||||||
|
@ -1358,6 +1414,7 @@ class homepageAlias(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class charteMA(boolAttr):
|
class charteMA(boolAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend= "Signale si l'adhérent a signé la charte de membres actifs"
|
legend= "Signale si l'adhérent a signé la charte de membres actifs"
|
||||||
|
@ -1367,6 +1424,7 @@ class charteMA(boolAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class homeDirectory(Attr):
|
class homeDirectory(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue=True
|
singlevalue=True
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -1392,6 +1450,7 @@ class homeDirectory(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class loginShell(Attr):
|
class loginShell(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = "Le shell de l'adherent"
|
legend = "Le shell de l'adherent"
|
||||||
|
@ -1408,6 +1467,7 @@ class loginShell(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class uidNumber(intAttr):
|
class uidNumber(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -1417,6 +1477,7 @@ class uidNumber(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class gidNumber(intAttr):
|
class gidNumber(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = "Le gid du compte de l'adhérent"
|
legend = "Le gid du compte de l'adhérent"
|
||||||
|
@ -1425,6 +1486,7 @@ class gidNumber(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class gecos(Attr):
|
class gecos(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = "Le gecos"
|
legend = "Le gecos"
|
||||||
|
@ -1433,6 +1495,7 @@ class gecos(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class userPassword(Attr):
|
class userPassword(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = "Le mot de passe"
|
legend = "Le mot de passe"
|
||||||
|
@ -1459,6 +1522,7 @@ class userPassword(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class sshFingerprint(Attr):
|
class sshFingerprint(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
legend = "Clef ssh de la machine"
|
legend = "Clef ssh de la machine"
|
||||||
|
@ -1506,6 +1570,7 @@ class sshFingerprint(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class gpgFingerprint(Attr):
|
class gpgFingerprint(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -1517,6 +1582,7 @@ class gpgFingerprint(Attr):
|
||||||
class gpgMail(mail):
|
class gpgMail(mail):
|
||||||
"""Attribut servant à stocker un mail allant de paire avec
|
"""Attribut servant à stocker un mail allant de paire avec
|
||||||
l'un des uid dans la clef gpg pointée par gpgFingerprint"""
|
l'un des uid dans la clef gpg pointée par gpgFingerprint"""
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -1532,6 +1598,7 @@ class gpgMail(mail):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class cn(Attr):
|
class cn(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = False
|
optional = False
|
||||||
category = 'id'
|
category = 'id'
|
||||||
|
@ -1539,6 +1606,7 @@ class cn(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class dn(Attr):
|
class dn(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = False
|
optional = False
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -1547,6 +1615,7 @@ class dn(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class postalAddress(Attr):
|
class postalAddress(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
can_modify = [soi, cableur, nounou, bureau]
|
can_modify = [soi, cableur, nounou, bureau]
|
||||||
|
@ -1556,6 +1625,7 @@ class postalAddress(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class controle(Attr):
|
class controle(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Contrôle"
|
legend = u"Contrôle"
|
||||||
|
@ -1570,6 +1640,7 @@ class controle(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class fid(intAttr):
|
class fid(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Id de facture"
|
legend = u"Id de facture"
|
||||||
category = 'factures'
|
category = 'factures'
|
||||||
optional = False
|
optional = False
|
||||||
|
@ -1578,6 +1649,7 @@ class fid(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class modePaiement(Attr):
|
class modePaiement(Attr):
|
||||||
|
__slots__ = ()
|
||||||
legend = u"Mode de paiement"
|
legend = u"Mode de paiement"
|
||||||
category = 'factures'
|
category = 'factures'
|
||||||
optional = False
|
optional = False
|
||||||
|
@ -1592,11 +1664,13 @@ class modePaiement(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class recuPaiement(Attr):
|
class recuPaiement(Attr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "recuPaiement"
|
ldap_name = "recuPaiement"
|
||||||
can_modify = [cableur, nounou]
|
can_modify = [cableur, nounou]
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class article(Attr):
|
class article(Attr):
|
||||||
|
__slots__ = ()
|
||||||
singlevalue = False
|
singlevalue = False
|
||||||
optional = True
|
optional = True
|
||||||
legend = u"Articles"
|
legend = u"Articles"
|
||||||
|
@ -1640,26 +1714,31 @@ class article(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class dnsIpv6(boolAttr):
|
class dnsIpv6(boolAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "dnsIpv6"
|
ldap_name = "dnsIpv6"
|
||||||
legend = "Détermine si l'ipv6 apparait dans le dns"
|
legend = "Détermine si l'ipv6 apparait dans le dns"
|
||||||
can_modify = [nounou, parent, cableur]
|
can_modify = [nounou, parent, cableur]
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class rewriteMailHeaders(boolAttr):
|
class rewriteMailHeaders(boolAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "rewriteMailHeaders"
|
ldap_name = "rewriteMailHeaders"
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class machineAlias(boolAttr):
|
class machineAlias(boolAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "machineAlias"
|
ldap_name = "machineAlias"
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class issuerCN(Attr):
|
class issuerCN(Attr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "issuerCN"
|
ldap_name = "issuerCN"
|
||||||
can_modify = [nounou]
|
can_modify = [nounou]
|
||||||
legend = "Common Name de l'éméteur du certificat"
|
legend = "Common Name de l'éméteur du certificat"
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class serialNumber(Attr):
|
class serialNumber(Attr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "serialNumber"
|
ldap_name = "serialNumber"
|
||||||
python_type = int
|
python_type = int
|
||||||
can_modify = [nounou]
|
can_modify = [nounou]
|
||||||
|
@ -1667,18 +1746,21 @@ class serialNumber(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class start(intAttr):
|
class start(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "start"
|
ldap_name = "start"
|
||||||
can_modify = [nounou]
|
can_modify = [nounou]
|
||||||
legend = "Date de début"
|
legend = "Date de début"
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class end(intAttr):
|
class end(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "end"
|
ldap_name = "end"
|
||||||
can_modify = [nounou]
|
can_modify = [nounou]
|
||||||
legend = "Date de fin"
|
legend = "Date de fin"
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class crlUrl(Attr):
|
class crlUrl(Attr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "crlUrl"
|
ldap_name = "crlUrl"
|
||||||
optional = True
|
optional = True
|
||||||
can_modify = [parent, nounou]
|
can_modify = [parent, nounou]
|
||||||
|
@ -1686,6 +1768,7 @@ class crlUrl(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class revocked(boolAttr):
|
class revocked(boolAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "revocked"
|
ldap_name = "revocked"
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
|
@ -1694,6 +1777,7 @@ class revocked(boolAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class encrypted(boolAttr):
|
class encrypted(boolAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "encrypted"
|
ldap_name = "encrypted"
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
optional = True
|
optional = True
|
||||||
|
@ -1702,6 +1786,7 @@ class encrypted(boolAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class privatekey(Attr):
|
class privatekey(Attr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "privatekey"
|
ldap_name = "privatekey"
|
||||||
python_type = str
|
python_type = str
|
||||||
can_modify = [parent, nounou]
|
can_modify = [parent, nounou]
|
||||||
|
@ -1710,6 +1795,7 @@ class privatekey(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class csr(Attr):
|
class csr(Attr):
|
||||||
|
__slots__ = ("data",)
|
||||||
ldap_name = "csr"
|
ldap_name = "csr"
|
||||||
python_type = str
|
python_type = str
|
||||||
can_modify = [parent, nounou]
|
can_modify = [parent, nounou]
|
||||||
|
@ -1739,6 +1825,7 @@ class csr(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class certificat(Attr):
|
class certificat(Attr):
|
||||||
|
__slots__ = ("data",)
|
||||||
ldap_name = "certificat"
|
ldap_name = "certificat"
|
||||||
binary = True
|
binary = True
|
||||||
python_type = str
|
python_type = str
|
||||||
|
@ -1799,6 +1886,7 @@ class certificat(Attr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class certificatUsage(intAttr):
|
class certificatUsage(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "certificatUsage"
|
ldap_name = "certificatUsage"
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
can_modify = [parent, nounou]
|
can_modify = [parent, nounou]
|
||||||
|
@ -1806,6 +1894,7 @@ class certificatUsage(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class selector(intAttr):
|
class selector(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "selector"
|
ldap_name = "selector"
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
can_modify = [parent, nounou]
|
can_modify = [parent, nounou]
|
||||||
|
@ -1813,6 +1902,7 @@ class selector(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class matchingType(intAttr):
|
class matchingType(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "matchingType"
|
ldap_name = "matchingType"
|
||||||
singlevalue = True
|
singlevalue = True
|
||||||
can_modify = [parent, nounou]
|
can_modify = [parent, nounou]
|
||||||
|
@ -1820,6 +1910,7 @@ class matchingType(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class xid(intAttr):
|
class xid(intAttr):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "xid"
|
ldap_name = "xid"
|
||||||
category = 'id'
|
category = 'id'
|
||||||
unique = True
|
unique = True
|
||||||
|
@ -1830,6 +1921,7 @@ class xid(intAttr):
|
||||||
|
|
||||||
@crans_attribute
|
@crans_attribute
|
||||||
class hostCert(dnsAttr):
|
class hostCert(dnsAttr):
|
||||||
|
__slots__ = ()
|
||||||
optional = False
|
optional = False
|
||||||
can_modify = [parent, nounou]
|
can_modify = [parent, nounou]
|
||||||
ldap_name = "hostCert"
|
ldap_name = "hostCert"
|
||||||
|
@ -1850,6 +1942,7 @@ class shadowExpire(intAttr):
|
||||||
Durée de validité du mot de passe d'un compte.
|
Durée de validité du mot de passe d'un compte.
|
||||||
On l'utilise en mettant sa valeur à 0 pour désactiver un compte
|
On l'utilise en mettant sa valeur à 0 pour désactiver un compte
|
||||||
"""
|
"""
|
||||||
|
__slots__ = ()
|
||||||
optinal = True
|
optinal = True
|
||||||
can_modify = [nounou, bureau]
|
can_modify = [nounou, bureau]
|
||||||
ldap_name = "shadowExpire"
|
ldap_name = "shadowExpire"
|
||||||
|
|
|
@ -82,6 +82,7 @@ def ldif_to_uldif(ldif):
|
||||||
class lc_ldap(ldap.ldapobject.LDAPObject, object):
|
class lc_ldap(ldap.ldapobject.LDAPObject, object):
|
||||||
"""Connexion à la base ldap crans, chaque instance représente une connexion
|
"""Connexion à la base ldap crans, chaque instance représente une connexion
|
||||||
"""
|
"""
|
||||||
|
__slots__ = ("lockholder", "conn", "dn", "droits", "current_login", "_username_given")
|
||||||
def __init__(self, dn=None, user=None, cred=None, uri=variables.uri,
|
def __init__(self, dn=None, user=None, cred=None, uri=variables.uri,
|
||||||
readonly_dn=None, readonly_password=None):
|
readonly_dn=None, readonly_password=None):
|
||||||
"""Initialise la connexion ldap,
|
"""Initialise la connexion ldap,
|
||||||
|
|
|
@ -86,6 +86,7 @@ class LdapLockHolder:
|
||||||
"""
|
"""
|
||||||
Système de gestion des locks pour une instance de lc_ldap.
|
Système de gestion des locks pour une instance de lc_ldap.
|
||||||
"""
|
"""
|
||||||
|
__slots__ = ("locks", "host", "pid", "conn", "timeout")
|
||||||
def __init__(self, conn):
|
def __init__(self, conn):
|
||||||
"""
|
"""
|
||||||
On crée la connexion, et on crée un dico vide.
|
On crée la connexion, et on crée un dico vide.
|
||||||
|
|
115
objets.py
115
objets.py
|
@ -66,14 +66,6 @@ import cranslib.deprecated
|
||||||
|
|
||||||
#: Champs à ignorer dans l'historique
|
#: Champs à ignorer dans l'historique
|
||||||
HIST_IGNORE_FIELDS = ["modifiersName", "entryCSN", "modifyTimestamp", "historique"]
|
HIST_IGNORE_FIELDS = ["modifiersName", "entryCSN", "modifyTimestamp", "historique"]
|
||||||
crans_account_attribs = [attributs.uid, attributs.canonicalAlias, attributs.solde,
|
|
||||||
attributs.contourneGreylist, attributs.derniereConnexion,
|
|
||||||
attributs.homepageAlias, attributs.loginShell, attributs.gecos,
|
|
||||||
attributs.uidNumber, attributs.homeDirectory,
|
|
||||||
attributs.gidNumber, attributs.userPassword,
|
|
||||||
attributs.mailAlias, attributs.cn, attributs.rewriteMailHeaders,
|
|
||||||
attributs.mailExt, attributs.compteWiki, attributs.droits,
|
|
||||||
attributs.shadowExpire]
|
|
||||||
|
|
||||||
def new_cransldapobject(conn, dn, mode='ro', uldif=None, lockId=None):
|
def new_cransldapobject(conn, dn, mode='ro', uldif=None, lockId=None):
|
||||||
"""Crée un objet :py:class:`CransLdapObject` en utilisant la classe correspondant à
|
"""Crée un objet :py:class:`CransLdapObject` en utilisant la classe correspondant à
|
||||||
|
@ -107,6 +99,7 @@ class CransLdapObject(object):
|
||||||
Cette classe ne devrait pas être utilisée directement."""
|
Cette classe ne devrait pas être utilisée directement."""
|
||||||
|
|
||||||
""" Qui peut faire quoi ? """
|
""" Qui peut faire quoi ? """
|
||||||
|
__slots__ = ("in_context", "conn", "lockId", "attrs", "_modifs", "dn", "parent_dn", "mode")
|
||||||
can_be_by = { variables.created: [attributs.nounou],
|
can_be_by = { variables.created: [attributs.nounou],
|
||||||
variables.modified: [attributs.nounou],
|
variables.modified: [attributs.nounou],
|
||||||
variables.deleted: [attributs.nounou],
|
variables.deleted: [attributs.nounou],
|
||||||
|
@ -218,9 +211,9 @@ class CransLdapObject(object):
|
||||||
# Sortie du context manager
|
# Sortie du context manager
|
||||||
self.in_context = False
|
self.in_context = False
|
||||||
# On rend les écriture impossible
|
# On rend les écriture impossible
|
||||||
self.save = self._out_of_context
|
#self.save = self._out_of_context
|
||||||
self.create = self._out_of_context
|
#self.create = self._out_of_context
|
||||||
self.delete = self._out_of_context
|
#self.delete = self._out_of_context
|
||||||
# On retombe en read only
|
# On retombe en read only
|
||||||
self.mode = 'ro'
|
self.mode = 'ro'
|
||||||
# On purge les lock de l'objet
|
# On purge les lock de l'objet
|
||||||
|
@ -805,6 +798,7 @@ class ObjectFactory(object):
|
||||||
Cette classe n'est jamais instanciée.
|
Cette classe n'est jamais instanciée.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
__slots__ = ()
|
||||||
_classes = {}
|
_classes = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -830,6 +824,7 @@ def crans_object(classe):
|
||||||
|
|
||||||
@crans_object
|
@crans_object
|
||||||
class InetOrgPerson(CransLdapObject):
|
class InetOrgPerson(CransLdapObject):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "inetOrgPerson"
|
ldap_name = "inetOrgPerson"
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return str(self.__class__.__name__) + " : cn=" + str(self['cn'][0])
|
return str(self.__class__.__name__) + " : cn=" + str(self['cn'][0])
|
||||||
|
@ -837,16 +832,33 @@ class InetOrgPerson(CransLdapObject):
|
||||||
|
|
||||||
class proprio(CransLdapObject):
|
class proprio(CransLdapObject):
|
||||||
u""" Un propriétaire de machine (adhérent, club…) """
|
u""" Un propriétaire de machine (adhérent, club…) """
|
||||||
|
__slots__ = ("_machines", "_factures", "full")
|
||||||
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.cableur],
|
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.cableur],
|
||||||
variables.modified: [attributs.nounou, attributs.bureau, attributs.soi, attributs.cableur],
|
variables.modified: [attributs.nounou, attributs.bureau, attributs.soi, attributs.cableur],
|
||||||
variables.deleted: [attributs.nounou, attributs.bureau,],
|
variables.deleted: [attributs.nounou, attributs.bureau,],
|
||||||
}
|
}
|
||||||
|
|
||||||
attribs = [attributs.nom, attributs.chbre, attributs.paiement, attributs.info,
|
|
||||||
|
crans_account_attribs = [attributs.uid, attributs.canonicalAlias, attributs.solde,
|
||||||
|
attributs.contourneGreylist, attributs.derniereConnexion,
|
||||||
|
attributs.homepageAlias, attributs.loginShell, attributs.gecos,
|
||||||
|
attributs.uidNumber, attributs.homeDirectory,
|
||||||
|
attributs.gidNumber, attributs.userPassword,
|
||||||
|
attributs.mailAlias, attributs.cn, attributs.rewriteMailHeaders,
|
||||||
|
attributs.mailExt, attributs.compteWiki, attributs.droits,
|
||||||
|
attributs.shadowExpire]
|
||||||
|
default_attribs = [attributs.nom, attributs.chbre, attributs.paiement, attributs.info,
|
||||||
attributs.blacklist, attributs.controle, attributs.historique,
|
attributs.blacklist, attributs.controle, attributs.historique,
|
||||||
attributs.debutAdhesion, attributs.finAdhesion, attributs.debutConnexion,
|
attributs.debutAdhesion, attributs.finAdhesion, attributs.debutConnexion,
|
||||||
attributs.finConnexion]
|
attributs.finConnexion]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def attribs(self):
|
||||||
|
if u'cransAccount' in self['objectClass']:
|
||||||
|
return self.default_attribs + self.crans_account_attribs
|
||||||
|
else:
|
||||||
|
return self.default_attribs
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return str(self.__class__.__name__) + " : nom=" + str(self['nom'][0])
|
return str(self.__class__.__name__) + " : nom=" + str(self['nom'][0])
|
||||||
|
|
||||||
|
@ -854,9 +866,6 @@ class proprio(CransLdapObject):
|
||||||
super(proprio, self).__init__(*args, **kwargs)
|
super(proprio, self).__init__(*args, **kwargs)
|
||||||
self._machines = None
|
self._machines = None
|
||||||
self._factures = None
|
self._factures = None
|
||||||
if u'cransAccount' in self['objectClass']:
|
|
||||||
self.attribs = self.attribs + crans_account_attribs
|
|
||||||
self.full = True
|
|
||||||
|
|
||||||
def delete_compte(self, mail):
|
def delete_compte(self, mail):
|
||||||
# Je pense qu'en pratique cette vérification ne sert à rien puisqu'on se fera jetter à la tentative de modification
|
# Je pense qu'en pratique cette vérification ne sert à rien puisqu'on se fera jetter à la tentative de modification
|
||||||
|
@ -880,7 +889,6 @@ class proprio(CransLdapObject):
|
||||||
self['mailExt']=[]
|
self['mailExt']=[]
|
||||||
self['uid' ]=[]
|
self['uid' ]=[]
|
||||||
self._modifs['objectClass'] = [u'adherent']
|
self._modifs['objectClass'] = [u'adherent']
|
||||||
self.attribs = list(set(self.attribs).difference(crans_account_attribs))
|
|
||||||
self.full = False
|
self.full = False
|
||||||
|
|
||||||
|
|
||||||
|
@ -907,9 +915,6 @@ class proprio(CransLdapObject):
|
||||||
if os.path.exists("/var/mail/" + login):
|
if os.path.exists("/var/mail/" + login):
|
||||||
raise ValueError('Création du compte impossible : /var/mail/%s existant' % str(login))
|
raise ValueError('Création du compte impossible : /var/mail/%s existant' % str(login))
|
||||||
|
|
||||||
if not self.full:
|
|
||||||
self.attribs = self.attribs + crans_account_attribs
|
|
||||||
self.full = True
|
|
||||||
self['uid' ] = [login]
|
self['uid' ] = [login]
|
||||||
self['homeDirectory'] = [home]
|
self['homeDirectory'] = [home]
|
||||||
self['mail'] = [login + u"@crans.org"]
|
self['mail'] = [login + u"@crans.org"]
|
||||||
|
@ -1094,6 +1099,7 @@ class proprio(CransLdapObject):
|
||||||
|
|
||||||
class machine(CransLdapObject):
|
class machine(CransLdapObject):
|
||||||
u""" Une machine """
|
u""" Une machine """
|
||||||
|
__slots__ = ("_proprio", "_certificats")
|
||||||
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.cableur, attributs.parent, attributs.respo],
|
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.cableur, attributs.parent, attributs.respo],
|
||||||
variables.modified: [attributs.nounou, attributs.bureau, attributs.cableur, attributs.parent, attributs.respo],
|
variables.modified: [attributs.nounou, attributs.bureau, attributs.cableur, attributs.parent, attributs.respo],
|
||||||
variables.deleted: [attributs.nounou, attributs.bureau, attributs.cableur, attributs.parent, attributs.respo],
|
variables.deleted: [attributs.nounou, attributs.bureau, attributs.cableur, attributs.parent, attributs.respo],
|
||||||
|
@ -1272,6 +1278,7 @@ class machine(CransLdapObject):
|
||||||
|
|
||||||
class AssociationCrans(proprio):
|
class AssociationCrans(proprio):
|
||||||
""" Association crans (propriétaire particulier)."""
|
""" Association crans (propriétaire particulier)."""
|
||||||
|
__slots__ = ()
|
||||||
def save(self):
|
def save(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1284,18 +1291,22 @@ class AssociationCrans(proprio):
|
||||||
return str(self.__class__.__name__) + " : Le Crans"
|
return str(self.__class__.__name__) + " : Le Crans"
|
||||||
|
|
||||||
class BaseInvites(proprio):
|
class BaseInvites(proprio):
|
||||||
u"""Un artefact de la base ldap"""
|
u"""Un artefact de la base ldap"""
|
||||||
|
__slots__ = ()
|
||||||
|
def __repr__(self):
|
||||||
|
return str(self.__class__.__name__)
|
||||||
|
|
||||||
def __repr__(self):
|
def delete(self, comm, login):
|
||||||
return str(self.__class__.__name__)
|
|
||||||
|
|
||||||
def delete(self, comm, login):
|
|
||||||
raise EnvironmentError("Les pauvres invites")
|
raise EnvironmentError("Les pauvres invites")
|
||||||
|
|
||||||
@crans_object
|
@crans_object
|
||||||
class adherent(proprio):
|
class adherent(proprio):
|
||||||
u"""Adhérent crans."""
|
u"""Adhérent crans."""
|
||||||
attribs = proprio.attribs + [attributs.aid, attributs.prenom, attributs.tel,
|
__slots__ = ("_clubs", "_imprimeur_clubs")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def attribs(self):
|
||||||
|
return super(adherent, self).attribs + [attributs.aid, attributs.prenom, attributs.tel,
|
||||||
attributs.mail, attributs.mailInvalide, attributs.charteMA,
|
attributs.mail, attributs.mailInvalide, attributs.charteMA,
|
||||||
attributs.derniereConnexion, attributs.gpgFingerprint,
|
attributs.derniereConnexion, attributs.gpgFingerprint,
|
||||||
attributs.carteEtudiant, attributs.etudes,
|
attributs.carteEtudiant, attributs.etudes,
|
||||||
|
@ -1334,23 +1345,32 @@ class adherent(proprio):
|
||||||
@crans_object
|
@crans_object
|
||||||
class club(proprio):
|
class club(proprio):
|
||||||
u"""Club crans"""
|
u"""Club crans"""
|
||||||
|
__slots__ = ()
|
||||||
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.cableur],
|
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.cableur],
|
||||||
variables.modified: [attributs.nounou, attributs.bureau, attributs.respo, attributs.cableur],
|
variables.modified: [attributs.nounou, attributs.bureau, attributs.respo, attributs.cableur],
|
||||||
variables.deleted: [attributs.nounou, attributs.bureau],
|
variables.deleted: [attributs.nounou, attributs.bureau],
|
||||||
}
|
}
|
||||||
attribs = proprio.attribs + [attributs.cid, attributs.responsable, attributs.imprimeurClub]
|
|
||||||
ldap_name = "club"
|
ldap_name = "club"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def attribs(self):
|
||||||
|
return super(club, self).attribs + [attributs.cid, attributs.responsable, attributs.imprimeurClub]
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super(club, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "Club : " + str(self['nom'][0])
|
return "Club : " + str(self['nom'][0])
|
||||||
|
|
||||||
@crans_object
|
@crans_object
|
||||||
class machineFixe(machine):
|
class machineFixe(machine):
|
||||||
u"""Machine fixe"""
|
u"""Machine fixe"""
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "machineFixe"
|
ldap_name = "machineFixe"
|
||||||
|
|
||||||
class machineMulticast(machine):
|
class machineMulticast(machine):
|
||||||
u"""Machine pour inféré à partir des announces sap"""
|
u"""Machine pour inféré à partir des announces sap"""
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = None
|
ldap_name = None
|
||||||
def save(self):
|
def save(self):
|
||||||
pass
|
pass
|
||||||
|
@ -1368,6 +1388,7 @@ class machineMulticast(machine):
|
||||||
@crans_object
|
@crans_object
|
||||||
class machineWifi(machine):
|
class machineWifi(machine):
|
||||||
u"""Machine wifi"""
|
u"""Machine wifi"""
|
||||||
|
__slots__ = ()
|
||||||
attribs = machine.attribs + [attributs.ipsec]
|
attribs = machine.attribs + [attributs.ipsec]
|
||||||
ldap_name = "machineWifi"
|
ldap_name = "machineWifi"
|
||||||
|
|
||||||
|
@ -1388,6 +1409,7 @@ class machineWifi(machine):
|
||||||
|
|
||||||
@crans_object
|
@crans_object
|
||||||
class machineCrans(machine):
|
class machineCrans(machine):
|
||||||
|
__slots__ = ()
|
||||||
can_be_by = { variables.created: [attributs.nounou],
|
can_be_by = { variables.created: [attributs.nounou],
|
||||||
variables.modified: [attributs.nounou],
|
variables.modified: [attributs.nounou],
|
||||||
variables.deleted: [attributs.nounou],
|
variables.deleted: [attributs.nounou],
|
||||||
|
@ -1397,6 +1419,7 @@ class machineCrans(machine):
|
||||||
|
|
||||||
@crans_object
|
@crans_object
|
||||||
class borneWifi(machine):
|
class borneWifi(machine):
|
||||||
|
__slots__ = ()
|
||||||
can_be_by = { variables.created: [attributs.nounou],
|
can_be_by = { variables.created: [attributs.nounou],
|
||||||
variables.modified: [attributs.nounou],
|
variables.modified: [attributs.nounou],
|
||||||
variables.deleted: [attributs.nounou],
|
variables.deleted: [attributs.nounou],
|
||||||
|
@ -1407,6 +1430,7 @@ class borneWifi(machine):
|
||||||
|
|
||||||
@crans_object
|
@crans_object
|
||||||
class switchCrans(machine):
|
class switchCrans(machine):
|
||||||
|
__slots__ = ()
|
||||||
can_be_by = { variables.created: [attributs.nounou],
|
can_be_by = { variables.created: [attributs.nounou],
|
||||||
variables.modified: [attributs.nounou],
|
variables.modified: [attributs.nounou],
|
||||||
variables.deleted: [attributs.nounou],
|
variables.deleted: [attributs.nounou],
|
||||||
|
@ -1417,6 +1441,7 @@ class switchCrans(machine):
|
||||||
|
|
||||||
@crans_object
|
@crans_object
|
||||||
class facture(CransLdapObject):
|
class facture(CransLdapObject):
|
||||||
|
__slots__ = ("_proprio", "_has_frais", "_recuPaiement", "_article_frais")
|
||||||
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.cableur],
|
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.cableur],
|
||||||
variables.modified: [attributs.nounou, attributs.bureau, attributs.cableur],
|
variables.modified: [attributs.nounou, attributs.bureau, attributs.cableur],
|
||||||
variables.deleted: [attributs.nounou, attributs.bureau, attributs.cableur],
|
variables.deleted: [attributs.nounou, attributs.bureau, attributs.cableur],
|
||||||
|
@ -1427,16 +1452,16 @@ class facture(CransLdapObject):
|
||||||
attributs.finConnexion, attributs.controle ]
|
attributs.finConnexion, attributs.controle ]
|
||||||
ldap_name = "facture"
|
ldap_name = "facture"
|
||||||
|
|
||||||
_proprio = None
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return str(self.__class__.__name__) + " : fid=" + str(self['fid'][0])
|
return str(self.__class__.__name__) + " : fid=" + str(self['fid'][0])
|
||||||
|
|
||||||
#### GROS HACK pour rester comptatible avec ldap_crans où l'article representant les frais n'est ajouté qu'une fois le paiement reçu
|
#### GROS HACK pour rester comptatible avec ldap_crans où l'article representant les frais n'est ajouté qu'une fois le paiement reçu
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
self._proprio = None
|
||||||
super(facture, self).__init__(*args, **kwargs)
|
super(facture, self).__init__(*args, **kwargs)
|
||||||
self._has_frais = True if [art for art in self.attrs.get('article', []) if art['code'] != 'FRAIS'] else False
|
self._has_frais = True if [art for art in self.attrs.get('article', []) if art['code'] != 'FRAIS'] else False
|
||||||
self._recuPaiement = True if self['recuPaiement'] else False
|
self._recuPaiement = True if self['recuPaiement'] else False
|
||||||
|
self._article_frais = None
|
||||||
|
|
||||||
def __getitem__(self,attr, default=None):
|
def __getitem__(self,attr, default=None):
|
||||||
ret = super(facture, self).__getitem__(attr, default)
|
ret = super(facture, self).__getitem__(attr, default)
|
||||||
|
@ -1451,7 +1476,6 @@ class facture(CransLdapObject):
|
||||||
raise EnvironmentError("Paiement déjà effectué pour cette facture, impossible de modifier son contenu")
|
raise EnvironmentError("Paiement déjà effectué pour cette facture, impossible de modifier son contenu")
|
||||||
return super(facture, self).__setitem__(attr, value)
|
return super(facture, self).__setitem__(attr, value)
|
||||||
|
|
||||||
_article_frais = None
|
|
||||||
def _frais(self, mode=None):
|
def _frais(self, mode=None):
|
||||||
if mode is None:
|
if mode is None:
|
||||||
mode = self['modePaiement'][0]
|
mode = self['modePaiement'][0]
|
||||||
|
@ -1536,11 +1560,12 @@ class facture(CransLdapObject):
|
||||||
|
|
||||||
@crans_object
|
@crans_object
|
||||||
class baseCert(CransLdapObject):
|
class baseCert(CransLdapObject):
|
||||||
|
__slots__ = ("_machine",)
|
||||||
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.parent],
|
can_be_by = { variables.created: [attributs.nounou, attributs.bureau, attributs.parent],
|
||||||
variables.modified: [attributs.nounou, attributs.bureau, attributs.parent],
|
variables.modified: [attributs.nounou, attributs.bureau, attributs.parent],
|
||||||
variables.deleted: [attributs.nounou, attributs.bureau, attributs.parent],
|
variables.deleted: [attributs.nounou, attributs.bureau, attributs.parent],
|
||||||
}
|
}
|
||||||
attribs = [ attributs.xid, attributs.certificat, attributs.hostCert, attributs.historique,
|
default_attribs = [ attributs.xid, attributs.certificat, attributs.hostCert, attributs.historique,
|
||||||
attributs.info, attributs.csr ]
|
attributs.info, attributs.csr ]
|
||||||
|
|
||||||
tlsa_attribs = [ attributs.certificatUsage, attributs.selector, attributs.matchingType,
|
tlsa_attribs = [ attributs.certificatUsage, attributs.selector, attributs.matchingType,
|
||||||
|
@ -1550,11 +1575,24 @@ class baseCert(CransLdapObject):
|
||||||
|
|
||||||
private_attribs = [ attributs.privatekey, attributs.encrypted ]
|
private_attribs = [ attributs.privatekey, attributs.encrypted ]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def attribs(self):
|
||||||
|
attribs = list(self.default_attribs)
|
||||||
|
if "TLSACert" in self['objectClass']:
|
||||||
|
attribs.extend(self.tlsa_attribs)
|
||||||
|
if 'x509Cert' in self['objectClass']:
|
||||||
|
attribs.extend(self.x509_attribs)
|
||||||
|
if "privateKey" in self['objectClass']:
|
||||||
|
attribs.extend(self.private_attribs)
|
||||||
|
return attribs
|
||||||
ldap_name = "baseCert"
|
ldap_name = "baseCert"
|
||||||
|
|
||||||
protected_issuer = [u'CAcert Class 3 Root', u'CA Cert Signing Authority']
|
protected_issuer = [u'CAcert Class 3 Root', u'CA Cert Signing Authority']
|
||||||
|
|
||||||
_machine = None
|
def __init__(self, *args, **kwargs):
|
||||||
|
self._machine = None
|
||||||
|
super(baseCert, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
if self['info']:
|
if self['info']:
|
||||||
|
@ -1562,14 +1600,6 @@ class baseCert(CransLdapObject):
|
||||||
else:
|
else:
|
||||||
return "Certificat : xid=" + str(self['xid'][0])
|
return "Certificat : xid=" + str(self['xid'][0])
|
||||||
|
|
||||||
def update_attribs(self):
|
|
||||||
if "TLSACert" in self['objectClass']:
|
|
||||||
self.attribs.extend(self.tlsa_attribs)
|
|
||||||
if 'x509Cert' in self['objectClass']:
|
|
||||||
self.attribs.extend(self.x509_attribs)
|
|
||||||
if "privateKey" in self['objectClass']:
|
|
||||||
self.attribs.extend(self.private_attribs)
|
|
||||||
|
|
||||||
def _check_setitem(self, attr, values):
|
def _check_setitem(self, attr, values):
|
||||||
"""
|
"""
|
||||||
Vérifie des contraintes non liées à LDAP lors d'un __setitem__,
|
Vérifie des contraintes non liées à LDAP lors d'un __setitem__,
|
||||||
|
@ -1589,7 +1619,7 @@ class baseCert(CransLdapObject):
|
||||||
if u"privateKey" in self['objectClass']:
|
if u"privateKey" in self['objectClass']:
|
||||||
return
|
return
|
||||||
self._modifs['objectClass'].append(u"privateKey")
|
self._modifs['objectClass'].append(u"privateKey")
|
||||||
self.attribs.extend(self.private_attribs)
|
#self.attribs.extend(self.private_attribs)
|
||||||
self['encrypted']=encrypted
|
self['encrypted']=encrypted
|
||||||
self['privatekey']=privatekey
|
self['privatekey']=privatekey
|
||||||
|
|
||||||
|
@ -1599,7 +1629,7 @@ class baseCert(CransLdapObject):
|
||||||
if u"TLSACert" in self['objectClass']:
|
if u"TLSACert" in self['objectClass']:
|
||||||
return
|
return
|
||||||
self._modifs['objectClass'].append(u"TLSACert")
|
self._modifs['objectClass'].append(u"TLSACert")
|
||||||
self.attribs.extend(self.tlsa_attribs)
|
#self.attribs.extend(self.tlsa_attribs)
|
||||||
self['certificatUsage']=certificatUsage
|
self['certificatUsage']=certificatUsage
|
||||||
self['matchingType']=matchingType
|
self['matchingType']=matchingType
|
||||||
self['selector']=0
|
self['selector']=0
|
||||||
|
@ -1610,7 +1640,7 @@ class baseCert(CransLdapObject):
|
||||||
if u"x509Cert" in self['objectClass']:
|
if u"x509Cert" in self['objectClass']:
|
||||||
return
|
return
|
||||||
self._modifs['objectClass'].append(u"x509Cert")
|
self._modifs['objectClass'].append(u"x509Cert")
|
||||||
self.attribs.extend(self.x509_attribs)
|
#self.attribs.extend(self.x509_attribs)
|
||||||
self['issuerCN'] = issuerCN
|
self['issuerCN'] = issuerCN
|
||||||
self['start'] = start
|
self['start'] = start
|
||||||
self['end'] = end
|
self['end'] = end
|
||||||
|
@ -1639,6 +1669,7 @@ class baseCert(CransLdapObject):
|
||||||
|
|
||||||
@crans_object
|
@crans_object
|
||||||
class service(CransLdapObject):
|
class service(CransLdapObject):
|
||||||
|
__slots__ = ()
|
||||||
ldap_name = "service"
|
ldap_name = "service"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -398,6 +398,7 @@ def services_to_restart(conn, old_attrs={}, new_attrs={}, created_object=[], del
|
||||||
# Identique à la classe dans ldap_crans.py
|
# Identique à la classe dans ldap_crans.py
|
||||||
class Service:
|
class Service:
|
||||||
""" Définit un service à redémarrer """
|
""" Définit un service à redémarrer """
|
||||||
|
__slots__ = ("nom", "args", "start")
|
||||||
def __init__(self, nom, args=[], start=[]):
|
def __init__(self, nom, args=[], start=[]):
|
||||||
"""
|
"""
|
||||||
Nom du service
|
Nom du service
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue