SHA256
1
0
forked from pool/salt

Accepting request 245201 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/245201
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/salt?expand=0&rev=36
This commit is contained in:
Ludwig Nussel 2014-08-20 15:51:44 +00:00 committed by Git OBS Bridge
parent fa42f45329
commit 2d50c1e863
3 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,31 @@
From 1539d14a40d976b94724b14a17aff77f9a273a9a Mon Sep 17 00:00:00 2001
From: Tim Serong <tserong@suse.com>
Date: Mon, 18 Aug 2014 23:00:39 +1000
Subject: [PATCH] Fix service.py version parsing for SLE 11
"osrelease" on SLES 11 is in the form "11 SP3", i.e. major version, then a space, then service pack number. This means we can't just split on '.' to get the major number for comparisons. Rather we need to split on non-digit characters to handle both space-delimited and dot-delimited release formats (yuck).
---
salt/modules/service.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/salt/modules/service.py b/salt/modules/service.py
index d581916..dab0817 100644
--- a/salt/modules/service.py
+++ b/salt/modules/service.py
@@ -49,7 +49,12 @@ def __virtual__():
# Suse >=12.0 uses systemd
if __grains__.get('os_family', '') == 'Suse':
try:
- if int(__grains__.get('osrelease', '').split('.')[0]) >= 12:
+ # osrelease might be in decimal format (e.g. "12.1"), or for
+ # SLES might include service pack (e.g. "11 SP3"), so split on
+ # non-digit characters, and the zeroth element is the major
+ # number (it'd be so much simpler if it was always "X.Y"...)
+ import re
+ if int(re.split('\D+', __grains__.get('osrelease', ''))[0]) >= 12:
return False
except ValueError:
return False
--
2.0.3

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Mon Aug 18 13:06:07 UTC 2014 - tserong@suse.com
- Fix service.py version parsing for SLE 11
+ Added fix-service-py-version-parsing-sles.patch
-------------------------------------------------------------------
Tue Aug 12 09:44:43 UTC 2014 - tserong@suse.com
- Remove salt-master's hard requirement for git and python-GitPython on SLE 12
-------------------------------------------------------------------
Wed Aug 6 06:36:02 UTC 2014 - tserong@suse.com

View File

@ -34,6 +34,8 @@ Patch3: pass-all-systemd-list-units.patch
Patch4: use-forking-daemon.patch
# PATCH-FIX-UPSTREAM disable-service-py-for-suse-family.patch tserong@suse.com -- ensure salt uses systemd for services on SLES
Patch5: disable-service-py-for-suse-family.patch
# PATCH-FIX-UPSTREAM fix-service-py-version-parsing-sles.patch tserong@suse.com -- fix SLES 11 version parsing
Patch6: fix-service-py-version-parsing-sles.patch
#for building
BuildRequires: fdupes
@ -146,8 +148,13 @@ Documentation of salt, offline version of http://docs.saltstack.com.
Summary: Management component for salt, a parallel remote execution system
Group: System/Monitoring
Requires: %{name} = %{version}
%if 0%{?suse_version} == 1315
Recommends: git
Recommends: python-GitPython
%else
Requires: git
Requires: python-GitPython
%endif
Requires: python-M2Crypto
Requires: python-msgpack-python
Requires: python-pycrypto
@ -237,6 +244,7 @@ Bash command line completion support for %{name}.
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build
python setup.py build