saltstack/salt

View on GitHub
pkg/suse/disable-service-py-for-suse-family.patch

Summary

Maintainability
Test Coverage
From 372d68180c35213de57b0b0b5a4773ffa92a4e5e Mon Sep 17 00:00:00 2001
From: Tim Serong <tserong@suse.com>
Date: Wed, 6 Aug 2014 16:33:07 +1000
Subject: [PATCH] Disable service.py for entire SUSE family >= 12

Checking os_family allows us to pick up openSUSE and SUSE Linux Enterprise, rather than just checking for os == openSUSE.
---
 salt/modules/service.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/salt/modules/service.py b/salt/modules/service.py
index cfafe24..d581916 100644
--- a/salt/modules/service.py
+++ b/salt/modules/service.py
@@ -47,7 +47,7 @@ def __virtual__():
     if __grains__['kernel'] != 'Linux':
         return False
     # SUSE >=12.0 uses systemd
-    if __grains__.get('os', '') == 'openSUSE':
+    if __grains__.get('os_family', '') == 'SUSE':
         try:
             if int(__grains__.get('osrelease', '').split('.')[0]) >= 12:
                 return False
-- 
2.0.3