[ldap_crans] ldap_crans ne modifie pas les host, hostAlias d'une machine ayant des certificats
C'est brûtal, mais je n'ai pas tu tout envie d'implémenter les certificat dans ldap_crans. On moins on peut toujours ajouter de nouveaux alias. De plus on interdit aussi la suppression d'une telle machine.
This commit is contained in:
parent
ff88440f2e
commit
328904ae19
2 changed files with 14 additions and 2 deletions
|
@ -933,7 +933,7 @@ def __prompt_input_menu(method, titre, prompt):
|
||||||
else:
|
else:
|
||||||
method([num-1, val])
|
method([num-1, val])
|
||||||
|
|
||||||
except ValueError, c:
|
except (EnvironmentError, ValueError) as c:
|
||||||
arg = u'--title "%s" ' % titre
|
arg = u'--title "%s" ' % titre
|
||||||
arg += u'--msgbox "%s\n\n\n" 0 0' % to_unicode(c.args[0])
|
arg += u'--msgbox "%s\n\n\n" 0 0' % to_unicode(c.args[0])
|
||||||
dialog(arg)
|
dialog(arg)
|
||||||
|
@ -1135,7 +1135,7 @@ def confirm(clas):
|
||||||
return 1
|
return 1
|
||||||
try:
|
try:
|
||||||
res = clas.save()
|
res = clas.save()
|
||||||
except RuntimeError, c:
|
except (EnvironmentError, RuntimeError) as c:
|
||||||
arg = u'--title "Enregistrement" '
|
arg = u'--title "Enregistrement" '
|
||||||
arg += u'--msgbox "%s\n\n\n" 0 0' % to_unicode(c.args[0])
|
arg += u'--msgbox "%s\n\n\n" 0 0' % to_unicode(c.args[0])
|
||||||
dialog(arg)
|
dialog(arg)
|
||||||
|
|
|
@ -3008,6 +3008,9 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3)
|
||||||
|
|
||||||
if type(new) == list:
|
if type(new) == list:
|
||||||
# Modif
|
# Modif
|
||||||
|
res = self.conn.search_s(self.dn, 1, "xid=*")
|
||||||
|
if res:
|
||||||
|
raise EnvironmentError("La machine possède des certificats, utilisez lc_ldap ou l'intranet2")
|
||||||
index = new[0]
|
index = new[0]
|
||||||
new = new[1]
|
new = new[1]
|
||||||
if new == '':
|
if new == '':
|
||||||
|
@ -3221,6 +3224,12 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3)
|
||||||
|
|
||||||
ret = ''
|
ret = ''
|
||||||
|
|
||||||
|
# test si la machine a des certificats
|
||||||
|
if 'host' in self.modifs:
|
||||||
|
res = self.conn.search_s(self.dn, 1, "xid=*")
|
||||||
|
if res:
|
||||||
|
raise EnvironmentError("La machine possède des certificats, utilisez lc_ldap ou l'intranet2")
|
||||||
|
|
||||||
# Besoin de redémarrer les firewalls ?
|
# Besoin de redémarrer les firewalls ?
|
||||||
if 'ipHostNumber' in self.modifs or 'macAddress' in self.modifs:
|
if 'ipHostNumber' in self.modifs or 'macAddress' in self.modifs:
|
||||||
reconf_ip = self._init_data.get('ipHostNumber', [])
|
reconf_ip = self._init_data.get('ipHostNumber', [])
|
||||||
|
@ -3301,6 +3310,9 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3)
|
||||||
if self.proprietaire().__class__ == AssociationCrans and not isadm():
|
if self.proprietaire().__class__ == AssociationCrans and not isadm():
|
||||||
raise EnvironmentError(u'Il faut être administrateur pour effectuer cette opération.')
|
raise EnvironmentError(u'Il faut être administrateur pour effectuer cette opération.')
|
||||||
|
|
||||||
|
res = self.conn.search_s(self.dn, 1, "xid=*")
|
||||||
|
if res:
|
||||||
|
raise EnvironmentError("La machine possède des certificats, utilisez lc_ldap ou l'intranet2")
|
||||||
|
|
||||||
self.proprio = self.__proprietaire.Nom() # On met dans un coin le nom du proprio
|
self.proprio = self.__proprietaire.Nom() # On met dans un coin le nom du proprio
|
||||||
self.__proprietaire = None # On oublie le propriétaire
|
self.__proprietaire = None # On oublie le propriétaire
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue