summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Albert <albertj@us.ibm.com>2017-08-23 14:39:10 -0500
committerJason Albert <albertj@us.ibm.com>2017-08-23 14:39:10 -0500
commitc99b75586e259c852d4ca66b62af943452714f83 (patch)
tree99b05d72a48238925b57f76b32f0c9b61c790262
parent020a8b151dc0447372236d0ad6ccbb508a61d35c (diff)
downloadvpdtools-c99b75586e259c852d4ca66b62af943452714f83.tar.gz
vpdtools-c99b75586e259c852d4ca66b62af943452714f83.zip
xmllint update to README and reverseVpd.py
- xmllint now only called in reverseVpd.py if installed warning thrown if not installed
-rw-r--r--README2
-rwxr-xr-xreverseVpd.py11
2 files changed, 8 insertions, 5 deletions
diff --git a/README b/README
index 3d6f6a8..9d8034c 100644
--- a/README
+++ b/README
@@ -30,7 +30,7 @@ Dependencies
Python 2.7 is required.
NOTE: RHEL6 is python 2.6 and this tool will not run there
-reverseVpd.py requires cmdline xmllint to cleanup the formatting of the output xml
+xmllint, if installed, is used to cleanup the formatting of the output xml
On Ubuntu/Debian: 'apt-get install libxml2-utils'
On Redhat/Fedora: 'yum install libxml2'
diff --git a/reverseVpd.py b/reverseVpd.py
index e8adce3..dff3839 100755
--- a/reverseVpd.py
+++ b/reverseVpd.py
@@ -320,10 +320,13 @@ writeTvpd(vpd, tvpdFileName)
out.msg("Wrote tvpd file: %s" % tvpdFileName)
# Now rip it through xmllint quick to cleanup formatting problems from the ET print
-rc = os.system("xmllint --format %s -o %s" % (tvpdFileName, tvpdFileName))
-if (rc):
- out.error("Unable to call xmllint to fixing xml formatting")
- exit(rc)
+if (os.path.isfile("/usr/bin/xmllint")):
+ rc = os.system("/usr/bin/xmllint --format %s -o %s" % (tvpdFileName, tvpdFileName))
+ if (rc):
+ out.error("Error occurred calling xmllint to fix xml formatting")
+ exit(rc)
+else:
+ out.warn("xmllint not installed - no formatting cleanup done!")
# Write the sub files
if (clCreateRecords):
OpenPOWER on IntegriCloud