summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-10-02 20:03:47 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-10-02 20:03:47 +0000
commit0d2e433555ffb7058bda65e92cf95b36f4368442 (patch)
treead684bc541b0e6eaa828859b2808db83e1977302 /src
parent8dc9f0550311fe60eb3581c835df802083afceba (diff)
downloadbcfg2-0d2e433555ffb7058bda65e92cf95b36f4368442.tar.gz
bcfg2-0d2e433555ffb7058bda65e92cf95b36f4368442.tar.bz2
bcfg2-0d2e433555ffb7058bda65e92cf95b36f4368442.zip
Admin-modes: Implement plugin whitelists/blacklists for modes that don't require
a full server Viz : Use the new blacklist option to speed up viz performance git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5474 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Admin/Viz.py7
-rw-r--r--src/lib/Server/Admin/__init__.py6
2 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/Server/Admin/Viz.py b/src/lib/Server/Admin/Viz.py
index 03a46335c..3945591f7 100644
--- a/src/lib/Server/Admin/Viz.py
+++ b/src/lib/Server/Admin/Viz.py
@@ -24,10 +24,15 @@ class Viz(Bcfg2.Server.Admin.MetadataCore):
colors = ['steelblue1', 'chartreuse', 'gold', 'magenta',
'indianred1', 'limegreen', 'orange1', 'lightblue2',
'green1', 'blue1', 'yellow1', 'darkturquoise', 'gray66']
+ plugin_blacklist = ['DBStats', 'Snapshots', 'Cfg', 'Pkgmgr', 'Packages',
+ 'Rules', 'Account', 'Decisions', 'Deps', 'Git', 'Svn',
+ 'Fossil', 'Bzr', 'Bundler', 'TGenshi', 'SGenshi', 'Base']
def __init__(self, cfile):
+
Bcfg2.Server.Admin.MetadataCore.__init__(self, cfile,
- self.__usage__)
+ self.__usage__,
+ pblacklist=self.plugin_blacklist)
def __call__(self, args):
Bcfg2.Server.Admin.MetadataCore.__call__(self, args)
diff --git a/src/lib/Server/Admin/__init__.py b/src/lib/Server/Admin/__init__.py
index 532afc65e..ecd2bd5b6 100644
--- a/src/lib/Server/Admin/__init__.py
+++ b/src/lib/Server/Admin/__init__.py
@@ -87,12 +87,16 @@ class Mode(object):
class MetadataCore(Mode):
'''Base class for admin-modes that handle metadata'''
- def __init__(self, configfile, usage):
+ def __init__(self, configfile, usage, pwhitelist=None, pblacklist=None):
Mode.__init__(self, configfile)
options = {'plugins': Bcfg2.Options.SERVER_PLUGINS}
setup = Bcfg2.Options.OptionParser(options)
setup.hm = usage
setup.parse(sys.argv[1:])
+ if pwhitelist is not None:
+ setup['plugins'] = [x for x in setup['plugins'] if x in pwhitelist]
+ elif pblacklist is not None:
+ setup['plugins'] = [x for x in setup['plugins'] if x not in pblacklist]
try:
self.bcore = Bcfg2.Server.Core.Core(self.get_repo_path(),
setup['plugins'],