summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Albert <albertj@us.ibm.com>2015-02-25 23:23:02 -0600
committerJason Albert <albertj@us.ibm.com>2015-02-25 23:23:02 -0600
commitd7b0291894a236d45cc609c6035d3f16cb0987e3 (patch)
tree866f27a3a8574840b12dff045e1975464e32a257
parentb3d231ab5e55fd5ee43f382c598a49be1f5f25ed (diff)
downloadvpdtools-d7b0291894a236d45cc609c6035d3f16cb0987e3.tar.gz
vpdtools-d7b0291894a236d45cc609c6035d3f16cb0987e3.zip
First pass at kwlen to data matching
-rwxr-xr-xcreateVpd.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/createVpd.py b/createVpd.py
index 1e2e76e..2b45cd7 100755
--- a/createVpd.py
+++ b/createVpd.py
@@ -225,6 +225,16 @@ for record in manifest.iter("record"):
error("The value of the RT keyword \"%s\" does not match the record name \"%s\"" % (kwvalue, recordName))
errorsFound+=1
+ # Verify that the data isn't longer than the length given
+ # Future checks could include making sure hex data is hex
+ if (kwtype.lower() == "ascii"):
+ if (len(kwvalue) > int(kwlen)):
+ error("The length of the value is longer than the given <kwlen> for keyword %s in record %s" % (keywordName, recordName))
+ errorsFound+=1
+ else:
+ error("Unknown keyword type \"%s\" given for keyword %s in record %s" % (kwtype, keywordName, recordName))
+ errorsFound+=1
+
if (errorsFound):
error("%d error%s found in the tvpd description. Please review the above errors and correct them." % (errorsFound, "s" if (errorsFound > 1) else ""))
tvpdFileName = clOutputPath + "/" + name + "-err.tvpd"
OpenPOWER on IntegriCloud