Fix failing pkg integration tests for releases with no '.'

Fedora releases are integers, and Arch's osrelease is simply `rolling`,
so https://github.com/saltstack/salt/pull/45636 caused these tests to
regress. This fixes them by moving the osrelease check until after the
MacOS check.

It also fixes the windows check, which would _always_ evaluate to `True`
since it was not calling the function. Therefore, the `if` would just be
a simple boolean which would resolve to `True` since it was just checking
a function reference.
This commit is contained in:
Erik Johnson 2018-01-24 09:57:02 -06:00
parent 0717f7a578
commit 4a6ab729dd
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -28,12 +28,13 @@ class PkgModuleTest(ModuleCase, SaltReturnAssertsMixin):
self.run_function('pkg.refresh_db')
os_release = self.run_function('grains.get', ['osrelease'])
self.pkg = 'htop'
if int(os_release.split('.')[1]) >= 13 and salt.utils.is_darwin():
if salt.utils.is_darwin() and int(os_release.split('.')[1]) >= 13:
self.pkg = 'wget'
elif salt.utils.is_windows:
elif salt.utils.is_windows():
self.pkg = 'putty'
else:
self.pkg = 'htop'
def test_list(self):
'''