summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Albert <albertj@us.ibm.com>2015-01-29 15:00:29 -0600
committerJason Albert <albertj@us.ibm.com>2015-01-29 15:00:29 -0600
commit8eff8ab3c91386b5468a00f307d7043b38ee979c (patch)
treec2ae4be94a1ad516fd1c3f5c90397412e7fade00
parent6461801ed0d5d325fc9dddd3764c426d0cc64608 (diff)
downloadvpdtools-8eff8ab3c91386b5468a00f307d7043b38ee979c.tar.gz
vpdtools-8eff8ab3c91386b5468a00f307d7043b38ee979c.zip
Intermediate checking before change merge functionality
-rwxr-xr-xcreateVpd.py43
1 files changed, 33 insertions, 10 deletions
diff --git a/createVpd.py b/createVpd.py
index 138a0ce..098bd2d 100755
--- a/createVpd.py
+++ b/createVpd.py
@@ -48,16 +48,39 @@ if (cmdline.parseOption("-h","--help")):
help()
exit(0)
-tree = ET.parse('tvpd/vini.tvpd')
-root = tree.getroot()
-root.tag
-root.attrib
-for child in root:
- print child.tag, child.attrib
-
-xml_files = glob.glob("tvpd/*.tvpd")
-
-m = merge(xml_files)
+# Look for input files - the option can be repeated multiple times
+clInputFiles = list()
+while True:
+ clInputFile = cmdline.parseOptionWithArg("-i")
+ if (clInputFile == None):
+ break
+ else:
+ clInputFiles.append(clInputFile)
+
+# Error check we got input files
+if (len(clInputFiles) == 0):
+ print("ERROR: At least 1 -i arg is required")
+ clError+=1
+
+# Error check the command line
+if (clError):
+ print("ERROR: Missing required cmdline args! Please review the output above to determine which ones!")
+ exit(clError)
+
+# All cmdline args should be processed, so if any left throw an error
+if (len(sys.argv) != 1):
+ print("ERROR: Extra cmdline args detected - %s" % (sys.argv[1:])) # [1:] don't inclue script name in the list
+ exit(len(sys.argv))
+
+files = list()
+for file in clInputFiles:
+ files.extend(glob.glob(file))
+
+#xml_files = glob.glob("tvpd/opfr.tvpd")
+
+print(files)
+
+m = merge(files)
print "++++++++++++++++"
print m
OpenPOWER on IntegriCloud