def migrate_auth_file(filename):
    'Create secrets or known tokens depending on what file is being migrated.'
    with open(str(filename), 'r') as f:
        rows = list(csv.reader(f))
    for row in rows:
        try:
            if row[0].startswith('#'):
                continue
            elif (filename == AUTH_BASIC_FILE):
                create_known_token(*row)
            elif (filename == AUTH_TOKENS_FILE):
                create_secret(*row)
            else:
                hookenv.log('Unknown auth file: {}'.format(filename))
                return False
        except IndexError:
            pass
    deprecate_auth_file(filename)
    return True
Create secrets or known tokens depending on what file is being migrated.
def migrate_auth_file(filename):
    
    with open(str(filename), 'r') as f:
        rows = list(csv.reader(f))
    for row in rows:
        try:
            if row[0].startswith('#'):
                continue
            elif (filename == AUTH_BASIC_FILE):
                create_known_token(*row)
            elif (filename == AUTH_TOKENS_FILE):
                create_secret(*row)
            else:
                hookenv.log('Unknown auth file: {}'.format(filename))
                return False
        except IndexError:
            pass
    deprecate_auth_file(filename)
    return True