[Oval-commits] r70 - trunk/tools/oval/definition

Pavel Vinogradov blaze-guest at alioth.debian.org
Wed Jul 11 09:25:53 UTC 2007


Author: blaze-guest
Date: 2007-07-11 09:25:53 +0000 (Wed, 11 Jul 2007)
New Revision: 70

Modified:
   trunk/tools/oval/definition/generator.py
Log:
Update generator to pass xsd validation

Modified: trunk/tools/oval/definition/generator.py
===================================================================
--- trunk/tools/oval/definition/generator.py	2007-07-10 19:29:37 UTC (rev 69)
+++ trunk/tools/oval/definition/generator.py	2007-07-11 09:25:53 UTC (rev 70)
@@ -82,10 +82,11 @@
 	
 	if not testsHash["dpkgObj"].has_key(name):
 		objectId = __getNewId ("object");
-		object = __createXMLElement("dpkginfo_object",
-								    attrs={"id":objectId, "version":"1",
-									 "xmlns":"http://oval.mitre.org/XMLSchema/oval-deinitions-5#linux"})
-		object.appendChild ( __createXMLElement ("name", name))
+		object = __createXMLElement("linux-def:dpkginfo_object",
+			attrs={"id":objectId, 
+				"version":"1",
+				"comment":"none"})
+		object.appendChild ( __createXMLElement ("linux-def:name", name))
 		objects.appendChild (object)
 
 		testsHash["dpkgObj"][name] = objectId
@@ -101,11 +102,12 @@
 	if not testsHash["dpkgSte"].has_key(operation) or not testsHash["dpkgSte"][operation].has_key(value):
 		stateId = __getNewId ("state")
 
-		state = __createXMLElement("dpkginfo_state", 
-								attrs={"id":stateId, "version":"1",
-									 "xmlns":"http://oval.mitre.org/XMLSchema/oval-deinitions-5#linux"})
+		state = __createXMLElement("linux-def:dpkginfo_state", 
+			attrs={"id":stateId, 
+				"version":"1",
+				"comment":"none"})
 		state.appendChild ( __createXMLElement 
-						 			("evr", value, 
+				("linux-def:evr", value, 
 						  			{"datatype":"evr_string", "operation":operation}))
 		states.appendChild (state)
 	
@@ -117,15 +119,15 @@
 	""" Generate OVAL DPKG test """
 	
 	ref = __getNewId ("test")
-	test = __createXMLElement("dpkginfo_test", 
+	test = __createXMLElement("linux-def:dpkginfo_test", 
 			attrs={"id":ref, 
 				"version":"1", 
 				"check":"all",
 				"check_existence":"at_least_one_exists",
-				"xmlns":"http://oval.mitre.org/XMLSchema/oval-deinitions-5#linux"
+				"comment":"none"
 			})
-	test.appendChild ( __createXMLElement("object", attrs={"object_ref" : __createOVALObject (name)}))
-	test.appendChild ( __createXMLElement("state", attrs={"state_ref" : __createOVALState (version)}))
+	test.appendChild ( __createXMLElement("linux-def:object", attrs={"object_ref" : __createOVALObject (name)}))
+	test.appendChild ( __createXMLElement("linux-def:state", attrs={"state_ref" : __createOVALState (version)}))
 	tests.appendChild(test)
 
 	return (ref)
@@ -137,12 +139,12 @@
 
 		ref = __getNewId("test")
 		
-		test = __createXMLElement("dpkginfo_test", 
+		test = __createXMLElement("linux-def:dpkginfo_test", 
 				attrs={"id":ref, 
 					"version":"1", 
 					"check":"all",
 					"check_existence":"at_least_one_exists",
-					"xmlns":"http://oval.mitre.org/XMLSchema/oval-deinitions-5#linux"
+					"comment":"none"
 			})
 		
 		if testType == "release":
@@ -150,8 +152,8 @@
 		else:
 			objectId = __createOVALObject ("architecture")
 		
-		test.appendChild ( __createXMLElement("object", attrs={"object_ref" : objectId}))
-		test.appendChild ( __createXMLElement("state", attrs={"state_ref" : __createOVALState (value, "equals")}))
+		test.appendChild ( __createXMLElement("linux-def:object", attrs={"object_ref" : objectId}))
+		test.appendChild ( __createXMLElement("linux-def:state", attrs={"state_ref" : __createOVALState (value, "equals")}))
 		tests.appendChild(test)
 				
 		testsHash[testType][value] = ref




More information about the Oval-commits mailing list