add a normalized_release function

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
tests for the new normalizer for versions

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
Merge pull request #229 from ceph/wip-9045

add a normalizer for distro versions
Added checks to the CentOS install scripts to properly detect CentOS 7 and set the correct repo information.

Added tests to confirm that the changes to CentOS detection are working correctly.

Signed-off-by: Tom Walsh <tom.walsh@expresshosting.net>
Fine tuned the tests to catch some more corner cases.

Adjusted the logic in install.py to match what was already there.

Signed-off-by: Tom Walsh <tom.walsh@expresshosting.net>
Reworked the release detection to normalize the value of distro.release as an integer and use that as the basis of determining the correct value of rpm_dist() and repository_url_part(). This should work for all versions of RH, CentOS, and SL going forward.

Signed-off-by: Tom Walsh <tom.walsh@expresshosting.net>
Added new line at the end of the file.

Signed-off-by: Tom Walsh <tom.walsh@expresshosting.net>
Modified the system to handle subversion numbers in the release number. For instance in production our server was reporting a release version of 7.0.1406. This is not a valid float() so the system was returning an el6 value. I have added additional logic to find the first . (dot) in the string and convert that to a float value.

I have also added a test to look for and test this corner case.
Added tests for the normalize_release function.

Signed-off-by: Tom Walsh <tom.walsh@expresshosting.net>
Modified the tests to reflect the desired output of normalize_release()

Added normalize_release() to the centos object so that the tests can properly execute.
Modified the rpm_dist() and repository_url_part()

So they can use the newly defined distro.normalized_release object to determine
the correct OS version and return the information based on that. This should
work for all releases from RHEL, CentOS, and Scientific Linux 6 and greater.

Changed the test_centos.py file to use pytest fixtures to test multiple input
types for the various OSes we are testing for.

Signed-off-by: Tom Walsh <tom.walsh@expresshosting.net>
Updates to the install.py rpm_dist() and repository_url_part()

to remove type casting and using the native ints in the normalized_release
object.

Signed-off-by: Tom Walsh <tom.walsh@expresshosting.net>

Closes #230