|
103 |
|
103 |
|
104 |
def change_server_password(configRegistry): |
104 |
def change_server_password(configRegistry): |
105 |
interval = configRegistry.get('server/password/interval', '21') |
105 |
interval = configRegistry.get('server/password/interval', '21') |
106 |
ucr_set('server/password/interval=-1') |
106 |
ucr_set(['server/password/interval=-1']) |
107 |
try: |
107 |
try: |
108 |
subprocess.check_call(['/usr/lib/univention-server/server_password_change']) |
108 |
subprocess.check_call(['/usr/lib/univention-server/server_password_change']) |
109 |
except subprocess.CalledProcessError: |
109 |
except subprocess.CalledProcessError: |
|
113 |
] |
113 |
] |
114 |
raise Critical(description=' '.join(error_descriptions)) |
114 |
raise Critical(description=' '.join(error_descriptions)) |
115 |
finally: |
115 |
finally: |
116 |
ucr_set('server/password/interval={}'.format(interval)) |
116 |
ucr_set(['server/password/interval={}'.format(interval)]) |
117 |
|
117 |
|
118 |
|
118 |
|
119 |
def restore_machine_password(role, ldap_connection): |
119 |
def restore_machine_password(role, ldap_connection): |
120 |
with open('/etc/machine.secret') as fob: |
120 |
with open('/etc/machine.secret') as fob: |
121 |
password = fob.read().rstrip('\n') |
121 |
password = fob.read() |
122 |
|
122 |
|
123 |
if not password: |
123 |
if not password: |
124 |
password = univention.lib.misc.createMachinePassword() |
124 |
password = univention.lib.misc.createMachinePassword() |