Less generic exception for subprocess.check_call.

https://docs.python.org/2/library/subprocess.html#exceptions
This commit is contained in:
Jakub Warmuz 2014-11-23 21:02:53 +01:00
parent cdde731aa4
commit 725d05e8ac

View file

@ -928,7 +928,7 @@ LogLevel warn \n\
subprocess.check_call(["sudo", "a2enmod", mod_name], stdout=open("/dev/null", 'w'), stderr=open("/dev/null", 'w'))
# Hopefully this waits for output
subprocess.check_call(["sudo", "/etc/init.d/apache2", "restart"], stdout=open("/dev/null", 'w'), stderr=open("/dev/null", 'w'))
except Exception as e:
except (OSError, subprocess.CalledProcessError) as e:
logger.error("Error enabling mod_" + mod_name)
logger.error("Exception: %s" % str(e))
sys.exit(1)