#465 Don't allow not-null empty arch/userID in listHosts
Merged by mikem. Opened by tkopecek.
tkopecek/koji issue463  into  master

Download 465.patch

Related: https://pagure.io/koji/issue/463

If empty string is passed, resulting SQL query is not valid.

This looks good to me.

I don't think we should construe an explicit value of "" to mean the same as None. It's an invalid input and we should raise an error, just a more sensible one that we are currently raising.

I've added check for archs and removed second one as it will fail on '%i' expansion it it is not a number.

rebased

That puts us back to the ugly sql error. Maybe something like this?

https://github.com/mikem23/koji-playground/commits/issue463

It add more db queries (it is also checked in CLI), but still more readable exception :-)

Also added a unit test

I don't think the extra queries are a problem for us, and they only come in when the option is specified. I guess we could eventually remove the check in the cli, once the hub change has been out for a while.

Commit e7dd4b36 fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

Metadata