Commit d8bac8d4 authored by Valentin Samir's avatar Valentin Samir

Ajout de l'attribut __slots__ aux classes pour économiser de la ram

parent 61bf8321
This diff is collapsed.
......@@ -82,6 +82,7 @@ def ldif_to_uldif(ldif):
class lc_ldap(ldap.ldapobject.LDAPObject, object):
"""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,
readonly_dn=None, readonly_password=None):
"""Initialise la connexion ldap,
......@@ -86,6 +86,7 @@ class LdapLockHolder:
Système de gestion des locks pour une instance de lc_ldap.
__slots__ = ("locks", "host", "pid", "conn", "timeout")
def __init__(self, conn):
On crée la connexion, et on crée un dico vide.
This diff is collapsed.
......@@ -398,6 +398,7 @@ def services_to_restart(conn, old_attrs={}, new_attrs={}, created_object=[], del
# Identique à la classe dans
class Service:
""" Définit un service à redémarrer """
__slots__ = ("nom", "args", "start")
def __init__(self, nom, args=[], start=[]):
Nom du service
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment