>From fa973347b57391e0264ff0570ba80518ec3cebde Mon Sep 17 00:00:00 2001
From: Shawn Wells <[email protected]>
Date: Thu, 17 Apr 2014 19:37:19 -0400
Subject: [PATCH 02/15] Updated RHEL6 OVAL template 'create_package_removed.py'
to build bash scripts
---
.../checks/templates/create_package_removed.py | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/RHEL/6/input/checks/templates/create_package_removed.py
b/RHEL/6/input/checks/templates/create_package_removed.py
index f777cc1..83e427f 100755
--- a/RHEL/6/input/checks/templates/create_package_removed.py
+++ b/RHEL/6/input/checks/templates/create_package_removed.py
@@ -4,9 +4,6 @@
# create_package_removed.py
# automatically generate checks for removed packages
#
-# NOTE: The file 'template_package_removed' should be located in the same
working directory as this script. The
-# template contains the following tags that *must* be replaced successfully in
order for the checks to work.
-#
# PKGNAME - the name of the package that should be removed
#
@@ -15,12 +12,20 @@ import sys, csv, re
def output_check(package_info):
pkgname = package_info[0]
if (pkgname):
- with open("./template_package_removed", 'r') as templatefile:
+ with open("./oval/package_removed", 'r') as templatefile:
filestring = templatefile.read()
filestring = filestring.replace("PKGNAME", pkgname)
with open("./output/package_" + pkgname + "_removed.xml", 'wb+')
as outputfile:
outputfile.write(filestring)
outputfile.close()
+ with open("./bash/package_installed", 'r') as BASHtemplatefile:
+ filestring = BASHtemplatefile.read()
+ filestring = filestring.replace("PKGNAME", pkgname)
+ with open("./output/package_" + pkgname + "_removed.sh", 'wb+')
as BASHoutputfile:
+ BASHoutputfile.write(filestring)
+ BASHoutputfile.close()
+ else:
+ print "ERROR: input violation: the package name must be defined"
def main():
if len(sys.argv) < 2:
--
1.7.1
_______________________________________________
scap-security-guide mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide