From 84ed5b78631828f77fb18424e29fab2f45c1a2b2 Mon Sep 17 00:00:00 2001 From: Nitin Madhok Date: Thu, 26 Jun 2014 13:44:45 -0400 Subject: [PATCH 1/2] Fixes the problem where service module is unavailable on RedHat, CentOs and Scientific Linux --- salt/modules/rh_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/modules/rh_service.py b/salt/modules/rh_service.py index f9ada924a2..2e19b8d7a4 100644 --- a/salt/modules/rh_service.py +++ b/salt/modules/rh_service.py @@ -55,10 +55,10 @@ def __virtual__(): )) if __grains__['os'] in enable: if __grains__['os'] == 'Fedora': - if __grains__.get('osrelease', 0) > 15: + if int(__grains__.get('osrelease', 0).split('.')[0]) > 15: return False if __grains__['os'] in ('RedHat','CentOS','ScientificLinux'): - if __grains__.get('osrelease', 0) >= 7: + if int(__grains__.get('osrelease', 0).split('.')[0]) >= 7: return False return __virtualname__ return False From 5157c2c93bd9ce22a97fecf1851e3a83b8ebf758 Mon Sep 17 00:00:00 2001 From: Nitin Madhok Date: Thu, 26 Jun 2014 13:55:57 -0400 Subject: [PATCH 2/2] Fixing merge conflict --- salt/modules/rh_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/rh_service.py b/salt/modules/rh_service.py index 2e19b8d7a4..9e6d3cfc30 100644 --- a/salt/modules/rh_service.py +++ b/salt/modules/rh_service.py @@ -57,7 +57,7 @@ def __virtual__(): if __grains__['os'] == 'Fedora': if int(__grains__.get('osrelease', 0).split('.')[0]) > 15: return False - if __grains__['os'] in ('RedHat','CentOS','ScientificLinux'): + if __grains__['os'] in ('RedHat', 'CentOS', 'ScientificLinux'): if int(__grains__.get('osrelease', 0).split('.')[0]) >= 7: return False return __virtualname__