Skip to content

Commit

Permalink
Display a critical error message is ran with both webserver and rpcse…
Browse files Browse the repository at this point in the history
…rver mode
  • Loading branch information
nicolargo committed Mar 19, 2023
1 parent 6eb6f9b commit a9bd0bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion glances/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ def parse_args(self):
logger.setLevel(DEBUG)
else:
from warnings import simplefilter

simplefilter("ignore")

# Plugins refresh rate
Expand Down Expand Up @@ -737,8 +736,17 @@ def parse_args(self):
self.args.is_server = self.is_server()
self.args.is_webserver = self.is_webserver()

# Check mode compatibility
self.check_mode_compatibility()

return args

def check_mode_compatibility(self):
"""Check mode compatibility"""
if self.args.is_server and self.args.is_webserver:
logger.critical("Server and Web server mode are incompatible")
sys.exit(2)

def is_standalone(self):
"""Return True if Glances is running in standalone mode."""
return not self.args.client and not self.args.browser and not self.args.server and not self.args.webserver
Expand Down

0 comments on commit a9bd0bd

Please sign in to comment.