gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r190983 - /gump/branches/Gump3/pygump/python/gump/engine/objectifier.py
Date Thu, 16 Jun 2005 19:06:43 GMT
Author: leosimons
Date: Thu Jun 16 12:06:43 2005
New Revision: 190983

URL: http://svn.apache.org/viewcvs?rev=190983&view=rev
Log:
Possible fix for GUMP-138.

* pygump/python/gump/engine/objectifier.py: Make the objectifier a little more robust by not
halting on objectification errors, but rather logging them and attempting to continue, doing
a 'partial' build.

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=190983&r1=190982&r2=190983&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/engine/objectifier.py (original)
+++ gump/branches/Gump3/pygump/python/gump/engine/objectifier.py Thu Jun 16 12:06:43 2005
@@ -370,8 +370,13 @@
             if not repository_definition.nodeType == dom.Node.ELEMENT_NODE: continue
             name = repository_definition.getAttribute("name")
             self.log.debug("Converting repository definition '%s' into object form." % name)
-            repository = _create_repository(workspace, repository_definition)
-            workspace.repositories[repository.name] = repository
+            try:
+                repository = _create_repository(workspace, repository_definition)
+                workspace.repositories[repository.name] = repository
+            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 repository definition '%s' into object
form." % name)
     
     def _find_repository_for_module(self, workspace, module_definition):
         name = module_definition.getAttribute("name")
@@ -384,10 +389,15 @@
             if not module_definition.nodeType == dom.Node.ELEMENT_NODE: continue
             name = module_definition.getAttribute("name")
             self.log.debug("Converting module definition '%s' into object form." % name)
-            repository = self._find_repository_for_module(workspace, module_definition)
-            module = _create_module(repository, module_definition)
-            module.repository.modules[module.name] = module
-            workspace.modules[module.name] = module
+            try:
+                repository = self._find_repository_for_module(workspace, module_definition)
+                module = _create_module(repository, module_definition)
+                module.repository.modules[module.name] = module
+                workspace.modules[module.name] = module
+            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 module definition '%s' into object
form." % name)
         
     def _find_module_for_project(self, workspace, project_definition):
         name = project_definition.getAttribute("name")
@@ -400,13 +410,18 @@
             if not project_definition.nodeType == dom.Node.ELEMENT_NODE: continue
             name = project_definition.getAttribute("name")
             self.log.debug("Converting project definition '%s' into object form." % name)
-            module = self._find_module_for_project(workspace, project_definition)
-            project = _create_project(module, project_definition)
-            project.module.projects[project.name] = project
-            workspace.projects[project.name] = project
-
-            _create_commands(project, project_definition)
-            _create_artifacts(project, project_definition)
+            try:
+                module = self._find_module_for_project(workspace, project_definition)
+                project = _create_project(module, project_definition)
+                project.module.projects[project.name] = project
+                workspace.projects[project.name] = project
+    
+                _create_commands(project, project_definition)
+                _create_artifacts(project, project_definition)
+            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)
 
         # wire up dependencies only after projects have been created
         for project_definition in project_definitions:



Mime
View raw message