Fix some bare except statements

This commit is contained in:
Alessio Sergi 2016-12-20 13:31:17 +01:00
parent 7f902d3f5b
commit 34434c5f44
4 changed files with 4 additions and 4 deletions

View File

@ -118,7 +118,7 @@ class Export(GlancesExport):
# Table # Table
try: try:
session.execute("CREATE TABLE %s (plugin text, time timeuuid, stat map<text,float>, PRIMARY KEY (plugin, time)) WITH CLUSTERING ORDER BY (time DESC)" % self.table) session.execute("CREATE TABLE %s (plugin text, time timeuuid, stat map<text,float>, PRIMARY KEY (plugin, time)) WITH CLUSTERING ORDER BY (time DESC)" % self.table)
except: except Exception:
logger.debug("Cassandra table %s already exist" % self.table) logger.debug("Cassandra table %s already exist" % self.table)
return cluster, session return cluster, session

View File

@ -93,7 +93,7 @@ class FolderList(object):
for i in ['careful', 'warning', 'critical']: for i in ['careful', 'warning', 'critical']:
try: try:
value[i] = self.config.get_value(section, key + i) value[i] = self.config.get_value(section, key + i)
except: except Exception:
value[i] = None value[i] = None
logger.debug("No {} threshold for folder {}".format(i, value["path"])) logger.debug("No {} threshold for folder {}".format(i, value["path"]))

View File

@ -158,7 +158,7 @@ class Plugin(GlancesPlugin):
# First time, try to connect to the server # First time, try to connect to the server
try: try:
self.docker_client = self.connect() self.docker_client = self.connect()
except: except Exception:
docker_tag = False docker_tag = False
else: else:
if self.docker_client is None: if self.docker_client is None:

View File

@ -98,7 +98,7 @@ class Plugin(GlancesPlugin):
netstatus = {} netstatus = {}
try: try:
netstatus = psutil.net_if_stats() netstatus = psutil.net_if_stats()
except: except AttributeError:
pass pass
# Previous network interface stats are stored in the network_old variable # Previous network interface stats are stored in the network_old variable