pySim-prog: use case insensitive CSV headers.

Inside of pySim all CSV headers are defined in lower case and are
evaluated case sensitive. This means that a CSV file that contains the
headers in uppercase for example will not parse. Lets make sure that the
CSV headers are evaluated case insensitive to increase compatibility
with slightly different formats.

Change-Id: I1a476e7fc521d1aad2956feec3db196156961d20
This commit is contained in:
Philipp Maier
2019-09-12 13:11:45 +02:00
parent 1de89bf889
commit 120a000e86

View File

@@ -456,6 +456,10 @@ def _read_params_csv(opts, iccid=None, imsi=None):
import csv
f = open(opts.read_csv, 'r')
cr = csv.DictReader(f)
# Lower-case fieldnames
cr.fieldnames = [ field.lower() for field in cr.fieldnames ]
i = 0
if not 'iccid' in cr.fieldnames:
raise Exception("CSV file in wrong format!")