[rhinstaller/anaconda/pulls/98 master] Fix bad IP checker in text installation

jkonecny12 installerbot-noreply at redhat.com
Mon May 11 11:41:14 UTC 2015


> The class name Fake_RE_Nameservers doesn't really describe what's happening. It looks like it's a boolean method that checks the IP address and returns whether or not is is valid. Is_Valid_IP_By_Regex would be easier to parse for future maintainers.
 
When you look on the source file you see that similar class is already present ``Fake_RE_IPV6`` I only used the same naming convention which was already there for some time. I think it's exactly how it's named fake regular expression class for nameservers.

> There is also similar ticket out there for nameservers entry failing when the entry is "X.X.X.X, Y.Y.Y.Y" due to the extra space as an invalid character. I was looking to actually use the validated IP to check and catch exceptions and return those to the logs and remove the entry from the list to prevent crashes. The failed entries would also show up on the screen with an abbreviated message to the user.

Could you please write here number of this bug?
 
> I like your concept of the wrapper class - what if we combined both solutions and had that code inside your wrapper using both the regular expression as well as an actual network validation that returns BOOLEAN, ErrorMessage and we can display the errors in the text client?

I don't agree with this idea. Fake regex class is purely for getting right input from user by providing fake regex class. I don't think this is the right place to test if the given IP is valid in the network. 
If we really need to test network validation it will be better place after input validation in my opinion.
-- 
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/98


More information about the anaconda-patches mailing list