mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-07 02:20:26 +03:00
Fix some bare except statements
This commit is contained in:
parent
7f902d3f5b
commit
34434c5f44
@ -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
|
||||||
|
@ -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"]))
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user