summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-02-02 20:22:43 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-02-02 20:22:43 +0000
commitbedb27cb29c9887b4340fdaff5a3975757a5da11 (patch)
tree5156bcb3a3e1f2a0a717de5fafb2c1e35867a111 /src
parentaf40c63767af1168e8277fa9b68a35ca9c89bfee (diff)
downloadbcfg2-bedb27cb29c9887b4340fdaff5a3975757a5da11.tar.gz
bcfg2-bedb27cb29c9887b4340fdaff5a3975757a5da11.tar.bz2
bcfg2-bedb27cb29c9887b4340fdaff5a3975757a5da11.zip
Clean up tool driver conflict code
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2769 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Frame.py18
-rw-r--r--src/lib/Client/Tools/SYSV.py4
-rw-r--r--src/lib/Server/Reports/settings.py4
3 files changed, 15 insertions, 11 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index 879ab0be2..b51b5d7ca 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -50,27 +50,27 @@ class Frame:
tools = self.setup['drivers'].split(',')
else:
tools = Bcfg2.Client.Tools.__all__[:]
- tmods = {}
+ tclass = {}
for tool in tools:
tool_class = "Bcfg2.Client.Tools.%s" % tool
try:
- tmods[tool] = __import__(tool_class, globals(), locals(), ['*'])
+ tclass[tool] = getattr(__import__(tool_class, globals(), locals(), ['*']),
+ tool)
except ImportError:
continue
- for (tool, mod) in tmods.iteritems():
+ for tool in tclass.values():
+ for conflict in getattr(tool, 'conflicts', []):
+ tclass.pop(conflict)
+
+ for tool in tclass.values():
try:
- self.tools.append(getattr(mod, tool)(self.logger, setup, config, self.states))
+ self.tools.append(tool(self.logger, setup, config, self.states))
except Bcfg2.Client.Tools.toolInstantiationError:
continue
except:
self.logger.error("Failed to instantiate tool %s" % (tool), exc_info=1)
- for tool in self.tools[:]:
- for conflict in getattr(tool, 'conflicts', []):
- [self.tools.remove(item) for item in self.tools \
- if item.__name__ == conflict]
-
self.logger.info("Loaded tool drivers:")
self.logger.info([tool.__name__ for tool in self.tools])
if not self.setup['dryrun']:
diff --git a/src/lib/Client/Tools/SYSV.py b/src/lib/Client/Tools/SYSV.py
index ad9bb00c5..002e7ae22 100644
--- a/src/lib/Client/Tools/SYSV.py
+++ b/src/lib/Client/Tools/SYSV.py
@@ -57,7 +57,9 @@ class SYSV(Bcfg2.Client.Tools.PkgTool):
(entry.get('version'), entry.get('name')))[0]
if cmdrc != 0:
- self.logger.debug("Package %s version incorrect" % entry.get('name'))
+ self.logger.debug("Package %s version incorrect: have %s want %s" \
+ % (entry.get('name'), self.installed[entry.get('name')],
+ entry.get('version')))
else:
if self.setup['quick'] or entry.attrib.get('verify', 'true') == 'false':
return True
diff --git a/src/lib/Server/Reports/settings.py b/src/lib/Server/Reports/settings.py
index 501da1749..7a17e0040 100644
--- a/src/lib/Server/Reports/settings.py
+++ b/src/lib/Server/Reports/settings.py
@@ -51,7 +51,7 @@ SECRET_KEY = 'eb5+y%oy-qx*2+62vv=gtnnxg1yig_odu0se5$h0hh#pc*lmo7'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
-# 'django.template.loaders.eggs.load_template_source',
+ 'django.template.loaders.eggs.load_template_source',
)
MIDDLEWARE_CLASSES = (
@@ -80,6 +80,8 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE = True
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates".
# Always use forward slashes, even on Windows.
+ '/usr/share/python-support/python-django/django/contrib/admin/templates/',
+ '/home/desai/dev/bcfg2/src/lib/Server/Reports/reports/templates'
)
INSTALLED_APPS = (