Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle empty fields in usersync _parse_csv() #1098

Merged
merged 2 commits into from
May 18, 2023
Merged

Conversation

paulineribeyre
Copy link
Contributor

@paulineribeyre paulineribeyre commented May 17, 2023

Traceback (most recent call last):
[...]
File "/fence/fence/sync/sync_users.py", line 1288, in _get_user_permissions_from_csv_list
 user_projects, user_info = self._parse_csv(
  File "/fence/fence/sync/sync_users.py", line 559, in _parse_csv
   phsid = row.get("phsid", "").split(".")
AttributeError: 'NoneType' object has no attribute 'split'

This appear to happens with a malformed CSV row missing some commas, for example:

user name,login,phsid,permission set,created,updated
user1,user1

Improvements

  • More robust CSV parsing in usersync

@coveralls
Copy link

coveralls commented May 17, 2023

Pull Request Test Coverage Report for Build 13559

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.003%) to 74.474%

Totals Coverage Status
Change from base Build 13548: -0.003%
Covered Lines: 7186
Relevant Lines: 9649

💛 - Coveralls

BinamB
BinamB previously approved these changes May 17, 2023
Copy link
Contributor

@BinamB BinamB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@paulineribeyre paulineribeyre merged commit f5a9ee4 into master May 18, 2023
5 of 6 checks passed
@paulineribeyre paulineribeyre deleted the fix/usersync-none branch May 18, 2023 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants