提交 7b102b82 编写于 作者: N nicolargo

Correct an issue when use --disable tags in client/server mode

上级 875f71f6
......@@ -116,9 +116,12 @@ class GlancesInstance(object):
"""All the methods of this class are published as XML-RPC methods."""
def __init__(self, cached_time=1, config=None):
def __init__(self,
cached_time=1,
config=None,
args=None):
# Init stats
self.stats = GlancesStatsServer(config)
self.stats = GlancesStatsServer(config=config, args=args)
# Initial update
self.stats.update()
......@@ -181,7 +184,8 @@ class GlancesServer(object):
"""This class creates and manages the TCP server."""
def __init__(self, requestHandler=GlancesXMLRPCHandler,
def __init__(self,
requestHandler=GlancesXMLRPCHandler,
cached_time=1,
config=None,
args=None):
......@@ -203,7 +207,7 @@ class GlancesServer(object):
# Register functions
self.server.register_introspection_functions()
self.server.register_instance(GlancesInstance(cached_time, config))
self.server.register_instance(GlancesInstance(cached_time, config, args))
if not self.args.disable_autodiscover:
# Note: The Zeroconf service name will be based on the hostname
......
......@@ -133,7 +133,7 @@ class GlancesStats(object):
def getAllPlugins(self):
"""Return the plugins list."""
return [p for p in self._plugins]
return [p for p in self._plugins if self._plugins[p].is_enable()]
def getExportList(self):
"""Return the exports modules list."""
......
......@@ -28,9 +28,11 @@ class GlancesStatsServer(GlancesStats):
"""This class stores, updates and gives stats for the server."""
def __init__(self, config=None):
def __init__(self,
config=None,
args=None):
# Init the stats
super(GlancesStatsServer, self).__init__(config=config)
super(GlancesStatsServer, self).__init__(config=config, args=args)
# Init the all_stats dict used by the server
# all_stats is a dict of dicts filled by the server
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册