Commit 1e24baee authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

wip

parent dbdb1853
...@@ -172,7 +172,7 @@ class EqueueServer(socketserver.ThreadingUnixStreamServer): ...@@ -172,7 +172,7 @@ class EqueueServer(socketserver.ThreadingUnixStreamServer):
try: try:
request.send(command) request.send(command)
except: except Exception:
self.logger.warning("Couldn't respond to %r", request.fileno()) self.logger.warning("Couldn't respond to %r", request.fileno())
self.close_request(request) self.close_request(request)
self._runCommandIfNeeded(command, timestamp) self._runCommandIfNeeded(command, timestamp)
......
...@@ -14,7 +14,7 @@ def get_curl(buffer, url): ...@@ -14,7 +14,7 @@ def get_curl(buffer, url):
result = "OK" result = "OK"
try: try:
curl.perform() curl.perform()
except: except Exception:
import traceback import traceback
traceback.print_exc(file=sys.stderr) traceback.print_exc(file=sys.stderr)
sys.stderr.flush() sys.stderr.flush()
......
...@@ -121,7 +121,7 @@ def runTestSuite(test_suite_title, test_suite_arguments, logger): ...@@ -121,7 +121,7 @@ def runTestSuite(test_suite_title, test_suite_arguments, logger):
parsed_arguments = dict(key.split('=') for key in test_suite_arguments) parsed_arguments = dict(key.split('=') for key in test_suite_arguments)
test_suite_module = importFrom(test_suite_title) test_suite_module = importFrom(test_suite_title)
success = test_suite_module.runTestSuite(**parsed_arguments) success = test_suite_module.runTestSuite(**parsed_arguments)
except: except Exception:
logger.exception('Impossible to run resiliency test:') logger.exception('Impossible to run resiliency test:')
success = False success = False
return success return success
...@@ -285,7 +285,7 @@ def runUnitTest(): ...@@ -285,7 +285,7 @@ def runUnitTest():
test_count=1, test_count=1,
error_count=error_count, error_count=error_count,
duration=test_duration) duration=test_duration)
except: except Exception:
raise raise
finally: finally:
os.remove(fname) os.remove(fname)
...@@ -213,7 +213,7 @@ class ERP5TestSuite(SlaprunnerTestSuite): ...@@ -213,7 +213,7 @@ class ERP5TestSuite(SlaprunnerTestSuite):
try: try:
if "erp5" == self._getCreatedERP5SiteId(): if "erp5" == self._getCreatedERP5SiteId():
break break
except: except Exception:
self.logger.info("Fail to connect to erp5.... wait a bit longer") self.logger.info("Fail to connect to erp5.... wait a bit longer")
pass pass
......
...@@ -445,7 +445,7 @@ def svcStopAll(config): ...@@ -445,7 +445,7 @@ def svcStopAll(config):
try: try:
return Popen([config['slapos'], 'node', 'supervisorctl', '--cfg', config['configuration_file_path'], return Popen([config['slapos'], 'node', 'supervisorctl', '--cfg', config['configuration_file_path'],
'stop', 'all']).communicate()[0] 'stop', 'all']).communicate()[0]
except: except Exception:
pass pass
def svcStartAll(config): def svcStartAll(config):
...@@ -453,7 +453,7 @@ def svcStartAll(config): ...@@ -453,7 +453,7 @@ def svcStartAll(config):
try: try:
return Popen([config['slapos'], 'node', 'supervisorctl', '--cfg', config['configuration_file_path'], return Popen([config['slapos'], 'node', 'supervisorctl', '--cfg', config['configuration_file_path'],
'start', 'all']).communicate()[0] 'start', 'all']).communicate()[0]
except: except Exception:
pass pass
def removeInstanceRootDirectory(config): def removeInstanceRootDirectory(config):
...@@ -601,7 +601,7 @@ def newSoftware(folder, config, session): ...@@ -601,7 +601,7 @@ def newSoftware(folder, config, session):
softwareContent = "" softwareContent = ""
try: try:
softwareContent = urlopen(software).read() softwareContent = urlopen(software).read()
except: except Exception:
#Software.cfg and instance.cfg content will be empty #Software.cfg and instance.cfg content will be empty
pass pass
with open(os.path.join(folderPath, config['software_profile']), 'w') as f: with open(os.path.join(folderPath, config['software_profile']), 'w') as f:
...@@ -799,7 +799,7 @@ def md5sum(file): ...@@ -799,7 +799,7 @@ def md5sum(file):
break break
m.update(data) m.update(data)
return m.hexdigest() return m.hexdigest()
except: except Exception:
return False return False
......
...@@ -259,7 +259,7 @@ def getFileLog(): ...@@ -259,7 +259,7 @@ def getFileLog():
with open(file_path) as f: with open(file_path) as f:
content = f.read() content = f.read()
return jsonify(code=1, result=html_escape(content)) return jsonify(code=1, result=html_escape(content))
except: except Exception:
return jsonify(code=0, result="Warning: Log file doesn't exist yet or empty log!!") return jsonify(code=0, result="Warning: Log file doesn't exist yet or empty log!!")
...@@ -717,7 +717,7 @@ def fileBrowser(): ...@@ -717,7 +717,7 @@ def fileBrowser():
filename) filename)
try: try:
return send_file(result, attachment_filename=filename, as_attachment=True) return send_file(result, attachment_filename=filename, as_attachment=True)
except: except Exception:
abort(404) abort(404)
elif opt == 9: elif opt == 9:
result = file_request.readFile(dir, filename, False) result = file_request.readFile(dir, filename, False)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment