mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-29 04:04:03 +03:00
Merge pull request #760 from notFloran/fix-debug-file-not-exist
Debug and WebUI : don't crash when the file does not exist
This commit is contained in:
commit
e217ff7ee5
@ -216,8 +216,11 @@ class GlancesBottle(object):
|
|||||||
|
|
||||||
if self.args.debug:
|
if self.args.debug:
|
||||||
fname = os.path.join(tempfile.gettempdir(), 'glances-debug.json')
|
fname = os.path.join(tempfile.gettempdir(), 'glances-debug.json')
|
||||||
with open(fname) as f:
|
try:
|
||||||
return f.read()
|
with open(fname) as f:
|
||||||
|
return f.read()
|
||||||
|
except IOError:
|
||||||
|
logger.debug("Debug file (%s) not found" % fname)
|
||||||
|
|
||||||
# Update the stat
|
# Update the stat
|
||||||
self.stats.update()
|
self.stats.update()
|
||||||
|
Loading…
Reference in New Issue
Block a user