def usage():
print """Usage:
- get-json-from-robot.py --xml=<output.xml> --pod=<pod_name>
- --installer=<installer> --database=<Database URL>
- --scenaro=SCENARIO
+ python odlreport2db.py --xml=<output.xml> --pod=<pod name>
+ --installer=<installer> --database=<database url>
+ --scenario=<scenario>
-x, --xml xml file generated by robot test
-p, --pod POD name where the test come from
-i, --installer
def main(argv):
+ (xml_file, pod, installer, scenario) = None, None, None, None
try:
opts, args = getopt.getopt(argv,
'x:p:i:s:h',
else:
usage()
+ if not all(x is not None for x in (xml_file, pod, installer, scenario)):
+ usage()
+
with open(xml_file, "r") as myfile:
xml_input = myfile.read().replace('\n', '')