You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by st...@apache.org on 2004/10/27 07:13:31 UTC
svn commit: rev 55672 - in gump/trunk: . python/gump/commands python/gump/core/loader
Author: stefano
Date: Tue Oct 26 22:13:30 2004
New Revision: 55672
Modified:
gump/trunk/gump.py
gump/trunk/python/gump/commands/check.py
gump/trunk/python/gump/core/loader/loader.py
Log:
first stab at metadata validation command. To try, type
python gump.py check
NOTE: if your workspace is the complete gump workspace, it will take a while.
Modified: gump/trunk/gump.py
==============================================================================
--- gump/trunk/gump.py (original)
+++ gump/trunk/gump.py Tue Oct 26 22:13:30 2004
@@ -99,7 +99,7 @@
elif (argv[1] in commands.__all__):
options = []
arguments = []
- for arg in argv:
+ for arg in argv[2:]:
if (arg[:1] == '='):
options.append(arg[1:])
else:
Modified: gump/trunk/python/gump/commands/check.py
==============================================================================
--- gump/trunk/python/gump/commands/check.py (original)
+++ gump/trunk/python/gump/commands/check.py Tue Oct 26 22:13:30 2004
@@ -15,38 +15,35 @@
# limitations under the License.
"""
-usage: build [options] [project]
+usage: check [workspace]
Perform the integration build.
Valid options:
- [TODO]
+ workspace
"""
-__description__ = "Check the integration"
+__description__ = "Check the gump metadata for validity and consistency"
__revision__ = "$Rev: 54600 $"
__date__ = "$Date: 2004-10-11 12:50:02 -0400 (Mon, 11 Oct 2004) $"
__copyright__ = "Copyright (c) 1999-2004 Apache Software Foundation"
__license__ = "http://www.apache.org/licenses/LICENSE-2.0"
-
-import gump.core.run.gumprun
-import gump.core.run.options
-from gump.core.runner.runner import getRunner
+import socket
+import logging
+from gump import log
from gump.core.loader.loader import WorkspaceLoader
-def process(options,arguments):
+def process(options,arguments):
+
+ if len(arguments) > 0:
+ ws = arguments[0]
+ else:
+ ws = "./metadata/" + socket.gethostname() + ".xml"
- # get parsed workspace definition
- workspace = WorkspaceLoader(options.isQuick()).load(ws)
-
- # Set objectives
- options.setObjectives(options.OBJECTIVE_CHECK)
+ log.setLevel(logging.DEBUG)
+
+ workspace = WorkspaceLoader().load(ws)
- # The Run Details...
- run = gumprun.GumpRun(workspace,ps,options)
-
- # Perform this integration run...
- return getRunner(run).perform()
-
\ No newline at end of file
+ workspace.dump()
Modified: gump/trunk/python/gump/core/loader/loader.py
==============================================================================
--- gump/trunk/python/gump/core/loader/loader.py (original)
+++ gump/trunk/python/gump/core/loader/loader.py Tue Oct 26 22:13:30 2004
@@ -56,24 +56,21 @@
from gump.util.http import cacheHTTP
urlFile=cacheHTTP(url,optimize=self.cache)
- log.debug('Launch XML/DOM parser onto \'URL\' [%s] [Base:%s] ' \
- % (url,basedir))
+ dom = self.load(urlFile,tag)
+
+ log.info('Parsed file %s/%s ' % (basedir,url))
- return self.load(urlFile,tag)
+ return dom
def load(self,file,tag=None):
"""
-
- Builds in memory from the xml file.
-
+ Builds in memory from the xml file.
"""
if not os.path.exists(file):
- log.error('Metadata file ['+file+'] not found')
+ log.error('Metadata file [' + file + '] not found')
raise IOError, 'Metadata File %s not found.' % file
- log.debug("Launch XML/DOM Parser onto : " + file);
-
dom=xml.dom.minidom.parse(file)
# We normalize the thing, 'cos we don't care about
@@ -91,8 +88,6 @@
dom.unlink()
raise IOError, 'Incorrect XML Element, expected %s found %s.' % (tag,xtag)
- log.debug("Parsed : " + file);
-
return dom
class XmlResult: