fix osfamily from Suse to SUSE

This commit is contained in:
Drew Adams 2016-05-26 22:08:40 -07:00
parent 4eb272da3c
commit bcd6a1cd77
24 changed files with 48 additions and 48 deletions

View file

@ -2434,7 +2434,7 @@ zypper install salt salt\-minion salt\-master
.fi
.UNINDENT
.UNINDENT
.SS Suse Linux Enterprise
.SS SUSE Linux Enterprise
.sp
For SLE 12 run the following as root:
.INDENT 0.0
@ -15972,8 +15972,8 @@ describes the package. An example of this file is:
.nf
.ft C
name: apache
os: RedHat, Debian, Ubuntu, Suse, FreeBSD
os_family: RedHat, Debian, Suse, FreeBSD
os: RedHat, Debian, Ubuntu, SUSE, FreeBSD
os_family: RedHat, Debian, SUSE, FreeBSD
version: 201506
release: 2
summary: Formula for installing Apache
@ -40629,7 +40629,7 @@ channels:
.UNINDENT
.INDENT 0.0
.IP \(bu 2
\fI\%OpenSuse Build Service\fP
\fI\%OpenSUSE Build Service\fP
.UNINDENT
.sp
Optionally WinRM can be used instead of \fIwinexe\fP if the python module \fIpywinrm\fP
@ -232592,7 +232592,7 @@ repo. Secondly, it will be the name of the file as stored in
.TP
.B humanname
This is used as the "name" value in the repo file in
\fB/etc/yum.repos.d/\fP (or \fB/etc/zypp/repos.d\fP for Suse distros).
\fB/etc/yum.repos.d/\fP (or \fB/etc/zypp/repos.d\fP for SUSE distros).
.TP
.B baseurl
The URL to a yum repository

View file

@ -28,7 +28,7 @@ channels:
.. __: http://rpm.pbone.net/index.php3?stat=3&search=winexe
* `OpenSuse Build Service`__
* `OpenSUSE Build Service`__
.. __: http://software.opensuse.org/package/winexe

View file

@ -137,7 +137,7 @@ For openSUSE 13.2 run the following as root:
zypper refresh
zypper install salt salt-minion salt-master
Suse Linux Enterprise
SUSE Linux Enterprise
---------------------
For SLE 12 run the following as root:

View file

@ -10,8 +10,8 @@ describes the package. An example of this file is:
.. code-block:: yaml
name: apache
os: RedHat, Debian, Ubuntu, Suse, FreeBSD
os_family: RedHat, Debian, Suse, FreeBSD
os: RedHat, Debian, Ubuntu, SUSE, FreeBSD
os_family: RedHat, Debian, SUSE, FreeBSD
version: 201506
release: 2
summary: Formula for installing Apache

View file

@ -52,7 +52,7 @@ Turning on the Salt Master is easy -- just turn it on! The default configuration
is suitable for the vast majority of installations. The Salt Master can be
controlled by the local Linux/Unix service manager:
On Systemd based platforms (newer Debian, OpenSuse, Fedora):
On Systemd based platforms (newer Debian, OpenSUSE, Fedora):
.. code-block:: bash

View file

@ -15,9 +15,9 @@ index cfafe24..d581916 100644
@@ -47,7 +47,7 @@ def __virtual__():
if __grains__['kernel'] != 'Linux':
return False
# Suse >=12.0 uses systemd
# SUSE >=12.0 uses systemd
- if __grains__.get('os', '') == 'openSUSE':
+ if __grains__.get('os_family', '') == 'Suse':
+ if __grains__.get('os_family', '') == 'SUSE':
try:
if int(__grains__.get('osrelease', '').split('.')[0]) >= 12:
return False

View file

@ -13,8 +13,8 @@ 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':
# 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

View file

@ -81,7 +81,7 @@ Tue Apr 9 18:56:15 UTC 2013 - aboe76@gmail.com
-------------------------------------------------------------------
Wed Jan 30 21:00:43 UTC 2013 - aboe76@gmail.com
- Updated spec file with Suse Copyright
- Updated spec file with SUSE Copyright
-------------------------------------------------------------------
Sat Jan 26 09:19:19 UTC 2013 - aboe76@gmail.com

View file

@ -1321,7 +1321,7 @@ Thu Feb 14 06:43:08 UTC 2013 - aboe76@gmail.com
-------------------------------------------------------------------
Wed Jan 30 20:57:57 UTC 2013 - aboe76@gmail.com
- Updated Suse Copyright in Spec-file
- Updated SUSE Copyright in Spec-file
-------------------------------------------------------------------
Mon Jan 28 15:23:08 UTC 2013 - toddrme2178@gmail.com

View file

@ -1030,14 +1030,14 @@ _OS_FAMILY_MAP = {
'VMwareESX': 'VMware',
'Bluewhite64': 'Bluewhite',
'Slamd64': 'Slackware',
'SLES': 'Suse',
'SUSE Enterprise Server': 'Suse',
'SUSE Enterprise Server': 'Suse',
'SLED': 'Suse',
'openSUSE': 'Suse',
'SUSE': 'Suse',
'openSUSE Leap': 'Suse',
'openSUSE Tumbleweed': 'Suse',
'SLES': 'SUSE',
'SUSE Enterprise Server': 'SUSE',
'SUSE Enterprise Server': 'SUSE',
'SLED': 'SUSE',
'openSUSE': 'SUSE',
'SUSE': 'SUSE',
'openSUSE Leap': 'SUSE',
'openSUSE Tumbleweed': 'SUSE',
'Solaris': 'Solaris',
'SmartOS': 'Solaris',
'OpenIndiana Development': 'Solaris',

View file

@ -52,7 +52,7 @@ def _detect_os():
os_family = __grains__['os_family']
if os_family == 'RedHat':
return 'apachectl'
elif os_family == 'Debian' or os_family == 'Suse':
elif os_family == 'Debian' or os_family == 'SUSE':
return 'apache2ctl'
else:
return 'apachectl'

View file

@ -74,7 +74,7 @@ class Inspector(object):
'''
if self.grains_core.os_data().get('os_family') == 'Debian':
return self.__get_cfg_pkgs_dpkg()
elif self.grains_core.os_data().get('os_family') in ['Suse', 'redhat']:
elif self.grains_core.os_data().get('os_family') in ['SUSE', 'redhat']:
return self.__get_cfg_pkgs_rpm()
else:
return dict()
@ -150,7 +150,7 @@ class Inspector(object):
if self.grains_core.os_data().get('os_family') == 'Debian':
cfg_data = salt.utils.to_str(self._syscall("dpkg", None, None, '--verify',
pkg_name)[0]).split(os.linesep)
elif self.grains_core.os_data().get('os_family') in ['Suse', 'redhat']:
elif self.grains_core.os_data().get('os_family') in ['SUSE', 'redhat']:
cfg_data = salt.utils.to_str(self._syscall("rpm", None, None, '-V', '--nodeps', '--nodigest',
'--nosignature', '--nomtime', '--nolinkto',
pkg_name)[0]).split(os.linesep)
@ -209,7 +209,7 @@ class Inspector(object):
'''
if self.grains_core.os_data().get('os_family') == 'Debian':
return self.__get_managed_files_dpkg()
elif self.grains_core.os_data().get('os_family') in ['Suse', 'redhat']:
elif self.grains_core.os_data().get('os_family') in ['SUSE', 'redhat']:
return self.__get_managed_files_rpm()
return list(), list(), list()

View file

@ -80,7 +80,7 @@ def _conf(family='ipv4'):
return '/var/lib/ip6tables/rules-save'
else:
return '/var/lib/iptables/rules-save'
elif __grains__['os_family'] == 'Suse':
elif __grains__['os_family'] == 'SUSE':
# SuSE does not seem to use separate files for IPv4 and IPv6
return '/etc/sysconfig/scripts/SuSEfirewall2-custom'
else:

View file

@ -132,7 +132,7 @@ def get_locale():
return params.get('LANG', '')
elif 'RedHat' in __grains__['os_family']:
cmd = 'grep "^LANG=" /etc/sysconfig/i18n'
elif 'Suse' in __grains__['os_family']:
elif 'SUSE' in __grains__['os_family']:
cmd = 'grep "^RC_LANG" /etc/sysconfig/language'
elif 'Debian' in __grains__['os_family']:
# this block only applies to Debian without systemd
@ -172,7 +172,7 @@ def set_locale(locale):
'LANG="{0}"'.format(locale),
append_if_not_found=True
)
elif 'Suse' in __grains__['os_family']:
elif 'SUSE' in __grains__['os_family']:
if not __salt__['file.file_exists']('/etc/sysconfig/language'):
__salt__['file.touch']('/etc/sysconfig/language')
__salt__['file.replace'](
@ -261,7 +261,7 @@ def gen_locale(locale, **kwargs):
on_debian = __grains__.get('os') == 'Debian'
on_ubuntu = __grains__.get('os') == 'Ubuntu'
on_gentoo = __grains__.get('os_family') == 'Gentoo'
on_suse = __grains__.get('os_family') == 'Suse'
on_suse = __grains__.get('os_family') == 'SUSE'
on_solaris = __grains__.get('os_family') == 'Solaris'
if on_solaris: # all locales are pre-generated

View file

@ -51,8 +51,8 @@ def __virtual__():
# Disable on all non-Linux OSes as well
if __grains__['kernel'] != 'Linux':
return (False, 'Non Linux OSes are not supported')
# Suse >=12.0 uses systemd
if __grains__.get('os_family', '') == 'Suse':
# SUSE >=12.0 uses systemd
if __grains__.get('os_family', '') == 'SUSE':
try:
# osrelease might be in decimal format (e.g. "12.1"), or for
# SLES might include service pack (e.g. "11 SP3"), so split on
@ -60,7 +60,7 @@ def __virtual__():
# number (it'd be so much simpler if it was always "X.Y"...)
import re
if int(re.split(r'\D+', __grains__.get('osrelease', ''))[0]) >= 12:
return (False, 'Suse version greater than or equal to 12 is not supported')
return (False, 'SUSE version greater than or equal to 12 is not supported')
except ValueError:
return (False, 'You are missing the os_family grain')
return 'service'

View file

@ -139,7 +139,7 @@ def get_zone():
if __grains__['os'].lower() == 'centos':
return _get_zone_etc_localtime()
os_family = __grains__['os_family']
for family in ('RedHat', 'Suse'):
for family in ('RedHat', 'SUSE'):
if family in os_family:
return _get_zone_sysconfig()
for family in ('Debian', 'Gentoo'):
@ -218,7 +218,7 @@ def set_zone(timezone):
if 'RedHat' in __grains__['os_family']:
__salt__['file.sed'](
'/etc/sysconfig/clock', '^ZONE=.*', 'ZONE="{0}"'.format(timezone))
elif 'Suse' in __grains__['os_family']:
elif 'SUSE' in __grains__['os_family']:
__salt__['file.sed'](
'/etc/sysconfig/clock', '^ZONE=.*', 'ZONE="{0}"'.format(timezone))
elif 'Debian' in __grains__['os_family']:
@ -312,7 +312,7 @@ def get_hwclock():
else:
os_family = __grains__['os_family']
for family in ('RedHat', 'Suse'):
for family in ('RedHat', 'SUSE'):
if family in os_family:
cmd = ['tail', '-n', '1', '/etc/adjtime']
return __salt__['cmd.run'](cmd, python_shell=False)
@ -401,7 +401,7 @@ def set_hwclock(clock):
elif 'RedHat' in __grains__['os_family']:
__salt__['file.sed'](
'/etc/sysconfig/clock', '^ZONE=.*', 'ZONE="{0}"'.format(timezone))
elif 'Suse' in __grains__['os_family']:
elif 'SUSE' in __grains__['os_family']:
__salt__['file.sed'](
'/etc/sysconfig/clock', '^ZONE=.*', 'ZONE="{0}"'.format(timezone))
elif 'Debian' in __grains__['os_family']:

View file

@ -54,9 +54,9 @@ def __virtual__():
'''
Set the virtual pkg module if the os is openSUSE
'''
if __grains__.get('os_family', '') != 'Suse':
if __grains__.get('os_family', '') != 'SUSE':
return (False, "Module zypper: non SUSE OS not suppored by zypper package manager")
# Not all versions of Suse use zypper, check that it is available
# Not all versions of SUSE use zypper, check that it is available
if not salt.utils.which('zypper'):
return (False, "Module zypper: zypper package manager not found")
return __virtualname__

View file

@ -128,7 +128,7 @@ def managed(name, ppa=None, **kwargs):
humanname
This is used as the "name" value in the repo file in
``/etc/yum.repos.d/`` (or ``/etc/zypp/repos.d`` for Suse distros).
``/etc/yum.repos.d/`` (or ``/etc/zypp/repos.d`` for SUSE distros).
baseurl
The URL to a yum repository

View file

@ -652,7 +652,7 @@ def get_ca_bundle(opts=None):
'/etc/pki/tls/certs/ca-bundle.trust.crt',
# RedHat's link for Debian compatibility
'/etc/ssl/certs/ca-bundle.crt',
# Suse has an unusual path
# SUSE has an unusual path
'/var/lib/ca-certificates/ca-bundle.pem',
# OpenBSD has an unusual path
'/etc/ssl/cert.pem',

View file

@ -220,7 +220,7 @@ class PkgModuleTest(integration.ModuleCase,
keys = ret.keys()
self.assertIn('rpm', keys)
self.assertIn('yum', keys)
elif os_family == 'Suse':
elif os_family == 'SUSE':
ret = self.run_function(func, ['less', 'zypper'])
keys = ret.keys()
self.assertIn('less', keys)

View file

@ -58,7 +58,7 @@ class UseraddModuleTest(integration.ModuleCase):
try:
uinfo = self.run_function('user.info', [uname])
if grains['os_family'] in ('Suse',):
if grains['os_family'] in ('SUSE',):
self.assertIn('users', uinfo['groups'])
else:
self.assertIn(uname, uinfo['groups'])

View file

@ -36,7 +36,7 @@ _PKG_TARGETS = {
'Debian': ['python-plist', 'apg'],
'RedHat': ['xz-devel', 'zsh-html'],
'FreeBSD': ['aalib', 'pth'],
'Suse': ['aalib', 'python-pssh']
'SUSE': ['aalib', 'python-pssh']
}

View file

@ -30,7 +30,7 @@ _PKG_TARGETS = {
'Debian': ['python-plist', 'apg'],
'RedHat': ['xz-devel', 'zsh-html'],
'FreeBSD': ['aalib', 'pth'],
'Suse': ['aalib', 'python-pssh'],
'SUSE': ['aalib', 'python-pssh'],
'MacOS': ['libpng', 'jpeg'],
}

View file

@ -151,7 +151,7 @@ class UserTest(integration.ModuleCase,
group_name = grp.getgrgid(ret['gid']).gr_name
self.assertTrue(os.path.isdir('/var/lib/salt_test'))
if grains['os_family'] in ('Suse',):
if grains['os_family'] in ('SUSE',):
self.assertEqual(group_name, 'users')
elif grains['os_family'] == 'MacOS':
self.assertEqual(group_name, 'staff')