Revisión 206
Añadido por Manu Mora Gordillo hace más de 13 años
controlies/trunk/applications/controlies/modules/Hosts.py | ||
---|---|---|
if self.type_host <> "thinclient":
|
||
if self.existsIP():
|
||
return "ipAlreadyExists"
|
||
|
||
#controlar overflow en nodos
|
||
if self.groupOverflow(300):
|
||
return "groupOverflow"
|
||
... | ... | |
]
|
||
|
||
self.ldap.add("cn="+self.name +",cn="+self.group+",cn=THINCLIENTS,cn=DHCP Config", attr)
|
||
|
||
else:
|
||
"""attr = [
|
||
('objectclass', ['top','organizationalRole','domainRelatedObject','ipHost','ieee802Device']),
|
||
('associatedDomain', ['santaeulalia']),
|
||
('cn', [self.name]),
|
||
('macAddress', [self.mac]),
|
||
('ipHostNumber', [self.ip])
|
||
]
|
||
self.ldap.add("cn="+self.name+",ou=Hosts", attr)
|
||
|
||
attr = [
|
||
('objectclass', ['dNSDomain2','domainRelatedObject']),
|
||
('associatedDomain', [self.name+'.santaeulalia']),
|
||
('dc', [self.name]),
|
||
('aRecord', [self.ip])
|
||
]
|
||
self.ldap.add("dc="+self.name+",dc=santaeulalia,ou=Hosts", attr)
|
||
|
||
attr = [
|
||
('objectclass', ['top','dhcpHost']),
|
||
('dhcpStatements', ['fixed-address '+self.name]),
|
||
('cn', [self.name]),
|
||
('dhcpHWAddress', ['ethernet '+self.mac])
|
||
]
|
||
self.ldap.add("cn="+self.name+",cn=group1,cn=INTERNAL,cn=DHCP Config", attr)"""
|
||
|
||
attr = [
|
||
(ldap.MOD_ADD, 'nisNetgroupTriple', ['('+self.name+',-,-)'] )
|
||
]
|
||
self.ldap.modify("cn=ltsp-server-hosts,ou=Netgroup", attr)
|
||
|
||
return "OK"
|
||
|
||
def modify(self):
|
Exportar a: Unified diff
Inserción de Hosts - no terminado