a warning should be more appropriate than crashing
This commit is contained in:
parent
3091f07d07
commit
69e1ecbf9d
|
@ -29,7 +29,7 @@ __revision__ = "$Id$"
|
||||||
|
|
||||||
import cryptobox.plugins.base
|
import cryptobox.plugins.base
|
||||||
import subprocess
|
import subprocess
|
||||||
import os, sys
|
import os
|
||||||
import cherrypy
|
import cherrypy
|
||||||
|
|
||||||
CERT_FILENAME = 'cryptobox-ssl-certificate.pem'
|
CERT_FILENAME = 'cryptobox-ssl-certificate.pem'
|
||||||
|
@ -120,8 +120,13 @@ class encrypted_webinterface(cryptobox.plugins.base.CryptoBoxPlugin):
|
||||||
if event == "bootup":
|
if event == "bootup":
|
||||||
cert_abs_name = self.cbox.prefs.get_misc_config_filename(CERT_FILENAME)
|
cert_abs_name = self.cbox.prefs.get_misc_config_filename(CERT_FILENAME)
|
||||||
if not os.path.isfile(cert_abs_name):
|
if not os.path.isfile(cert_abs_name):
|
||||||
|
cert = self.__get_certificate()
|
||||||
|
if cert is None:
|
||||||
|
## failed to create a certificate?
|
||||||
|
self.cbox.log.warn("Failed to import M2Crypto python module" \
|
||||||
|
+ " required for SSL certificate generation")
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
cert = self.__get_certificate()
|
|
||||||
self.cbox.prefs.create_misc_config_file(CERT_FILENAME, cert)
|
self.cbox.prefs.create_misc_config_file(CERT_FILENAME, cert)
|
||||||
self.cbox.log.info("Created new SSL certificate: %s" % \
|
self.cbox.log.info("Created new SSL certificate: %s" % \
|
||||||
cert_abs_name)
|
cert_abs_name)
|
||||||
|
@ -217,9 +222,8 @@ class encrypted_webinterface(cryptobox.plugins.base.CryptoBoxPlugin):
|
||||||
try:
|
try:
|
||||||
import M2Crypto
|
import M2Crypto
|
||||||
except ImportError:
|
except ImportError:
|
||||||
sys.stderr.write("Plugin encrypted_webinterface could not import M2Crypto module!\n")
|
## failed to import the module
|
||||||
sys.stderr.write("Try 'apt-get install python-m2crypto'.\n")
|
return None
|
||||||
sys.exit(1)
|
|
||||||
import time
|
import time
|
||||||
string_type = 0x1000 | 1 # see http://www.koders.com/python/..
|
string_type = 0x1000 | 1 # see http://www.koders.com/python/..
|
||||||
# ../fid07A99E089F55187896A06CD4E0B6F21B9B8F5B0B.aspx?s=bavaria
|
# ../fid07A99E089F55187896A06CD4E0B6F21B9B8F5B0B.aspx?s=bavaria
|
||||||
|
|
Loading…
Reference in New Issue