def _read_credentials_csv()

in geneve/stack/prober_elastic.py [0:0]


def _read_credentials_csv(fp):
    import csv

    reader = csv.reader(fp)
    # read the first row
    row = next(reader)
    # if it contains headers, read the next
    if row[0].strip().lower() == "username" and row[1].strip().lower() == "password":
        row = next(reader)
    # username and password are expected in the first two columns
    return tuple(column.strip() for column in row[:2])