diff options
author | Jason Albert <albertj@us.ibm.com> | 2017-08-23 14:39:10 -0500 |
---|---|---|
committer | Jason Albert <albertj@us.ibm.com> | 2017-08-23 14:39:10 -0500 |
commit | c99b75586e259c852d4ca66b62af943452714f83 (patch) | |
tree | 99b05d72a48238925b57f76b32f0c9b61c790262 | |
parent | 020a8b151dc0447372236d0ad6ccbb508a61d35c (diff) | |
download | vpdtools-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-- | README | 2 | ||||
-rwxr-xr-x | reverseVpd.py | 11 |
2 files changed, 8 insertions, 5 deletions
@@ -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): |