gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r209806 - /gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
Date Fri, 08 Jul 2005 15:02:51 GMT
Author: leosimons
Date: Fri Jul  8 08:02:50 2005
New Revision: 209806

URL: http://svn.apache.org/viewcvs?rev=209806&view=rev
Log:
Fix a bug in objectifier where it would raise an exception if a project_definition does not
have a name.

Modified:
    gump/branches/Gump3/pygump/python/gump/engine/objectifier.py

Modified: gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/engine/objectifier.py?rev=209806&r1=209805&r2=209806&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/objectifier.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/objectifier.py Fri Jul  8 08:02:50 2005
@@ -362,6 +362,9 @@
     
     def __init__(self, log, workdir):
         """Store all settings and dependencies as properties."""
+        assert hasattr(log,"debug") and callable(log.debug)
+        assert os.path.isdir(workdir)
+        
         self.log = log
         self.workdir = workdir
 
@@ -431,6 +434,8 @@
         return module
 
     def _create_projects(self, workspace, project_definitions):
+        problems = []
+        
         for project_definition in project_definitions:
             if not project_definition.nodeType == dom.Node.ELEMENT_NODE: continue
             name = project_definition.getAttribute("name")
@@ -444,9 +449,8 @@
                 _create_commands(project, project_definition)
                 _create_outputs(project, project_definition, self.workdir)
             except:
-                # TODO: the name of the failing element and ideally the source xml file should
be
-                #       reported somewhere and e.g. e-mailed to the gump admins
                 self.log.exception("Failed to convert project definition '%s' into object
form." % name)
+                problems.append(name)
 
         # wire up dependencies only after projects have been created
         for project_definition in project_definitions:
@@ -454,12 +458,12 @@
             try:
                 _create_dependencies(project_definition, workspace.projects)
             except:
-                # TODO this is introducing a dependency on the engine
-                # algorithm. Need to move the "failure" logic closer to
-                # the "core" model.
                 from gump.model.util import mark_failure
                 from gump.engine.algorithm import ExceptionInfo
                 (type, value, traceback) = sys.exc_info()
                 cause = ExceptionInfo(type, value, traceback)
-                mark_failure(project, cause)
                 self.log.error(cause)
+                name = project_definition.getAttribute("name")
+                if name and not name in problems:
+                    project = workspace.projects[name]
+                    mark_failure(project, cause)



Mime
View raw message