Lines 159-169
def create_certificate(hostname, domainname):
|
Link Here
|
---|
|
159 |
ud.debug(ud.LISTENER, ud.INFO, |
159 |
ud.debug(ud.LISTENER, ud.INFO, |
160 |
'CERTIFICATE: Creating certificate %s' % hostname) |
160 |
'CERTIFICATE: Creating certificate %s' % hostname) |
161 |
|
161 |
|
162 |
cmd = '. /usr/share/univention-ssl/make-certificates.sh;gencert "%s" "%s"' % \ |
162 |
with tempfile.NamedTemporaryFile() as fd: |
163 |
(fqdn, fqdn) |
163 |
fd.write('. /usr/share/univention-ssl/make-certificates.sh;gencert "$UCS_FQDN" "$UCS_FQDN"') |
164 |
ret = subprocess.call(cmd, shell=True) |
164 |
fd.flush() |
165 |
if ret: |
165 |
env = os.environ.copy() |
166 |
raise Exception("Certificate creation failed.") |
166 |
env['UCS_FQDN'] = fqdn |
|
|
167 |
ret = subprocess.call(['/bin/sh', fd.name]) |
168 |
if ret: |
169 |
raise Exception("Certificate creation failed.") |
167 |
|
170 |
|
168 |
# Create symlink |
171 |
# Create symlink |
169 |
try: |
172 |
try: |