Merge branch '2589-error-using-glances-export-to-influxdb2' into develop

pull/2590/head^2
nicolargo 2023-10-29 10:23:56 +01:00
commit 091e4975ca
2 changed files with 17 additions and 4 deletions

View File

@ -139,10 +139,19 @@ class _GlancesCurses(object):
self.space_between_line = 2
# Init the curses screen
self.screen = curses.initscr()
if not self.screen:
logger.critical("Cannot init the curses library.\n")
sys.exit(1)
try:
self.screen = curses.initscr()
if not self.screen:
logger.critical("Cannot init the curses library.\n")
sys.exit(1)
except Exception as e:
if args.export:
logger.info("Cannot init the curses library, quiet mode on and export.")
args.quiet = True
return
else:
logger.critical("Cannot init the curses library ({})".format(e))
sys.exit(1)
# Load the 'outputs' section of the configuration file
# - Init the theme (default is black)

View File

@ -105,6 +105,10 @@ class GlancesStandalone(object):
# Init screen
self.screen = GlancesCursesStandalone(config=config, args=args)
# If an error occur during the screen init, continue if export option is set
# It is done in the screen.init function
self._quiet = args.quiet
# Check the latest Glances version
self.outdated = Outdated(config=config, args=args)