sot / cheta

Cheta Telemetry Archive
https://sot.github.io/eng_archive
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

cheta archive update method doesn't handle periods in usernames #239

Closed matthewdahmer closed 2 years ago

matthewdahmer commented 2 years ago

When setting up Christian Anderson's local archive, we encountered an error indicating:

ValueError: could not parse christian.anderson@<ip> into username@host:path

In looking at the code, I can see that the regular expression assumes the username fits within the "\w" pattern, however Christian's username has a dot/period which doesn't fit within this pattern.

https://github.com/sot/eng_archive/blob/eeb99b10a7f44dd38e11551f94402bd67c0bf9d4/Ska/engarchive/update_client_archive.py#L239

This may be able to be fixed using the following syntax: match = re.match(r'([\w.]+)@([\w.]+)(:.+)?', opt.server_data_root)

matthewdahmer commented 2 years ago

Tagging @christian-anderson

taldcroft commented 2 years ago

Do'ooh! That's weird, I don't think I've ever seen a linux username with a period in it. Some googling led to this talk, which implies that a period in the user name is legal but not a great idea.

Did you figure a workaround or hack the code to make it work?

matthewdahmer commented 2 years ago

I will test PR #240 on his machine next time we meet (in person or remotely)