mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Added support for is_fedora and skip Minion test test_issue_7754
This commit is contained in:
parent
5d3bcd7af0
commit
30f3bda712
2 changed files with 23 additions and 0 deletions
|
@ -8,6 +8,18 @@ import os
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
import warnings
|
||||
# linux_distribution deprecated in py3.7
|
||||
try:
|
||||
from platform import linux_distribution as _deprecated_linux_distribution
|
||||
|
||||
def linux_distribution(**kwargs):
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore")
|
||||
return _deprecated_linux_distribution(**kwargs)
|
||||
except ImportError:
|
||||
from distro import linux_distribution
|
||||
|
||||
# Import Salt libs
|
||||
from salt.utils.decorators import memoize as real_memoize
|
||||
|
||||
|
@ -159,3 +171,13 @@ def is_aix():
|
|||
Simple function to return if host is AIX or not
|
||||
'''
|
||||
return sys.platform.startswith('aix')
|
||||
|
||||
|
||||
@real_memoize
|
||||
def is_fedora():
|
||||
'''
|
||||
Simple function to return if host is Fedora or not
|
||||
'''
|
||||
(osname, osrelease, oscodename) = \
|
||||
[x.strip('"').strip("'") for x in linux_distribution()]
|
||||
return osname == 'Fedora'
|
||||
|
|
|
@ -50,6 +50,7 @@ class MinionTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMix
|
|||
)
|
||||
|
||||
@skipIf(salt.utils.platform.is_darwin(), 'Test is flaky on macosx')
|
||||
@skipIf(salt.utils.platform.is_fedora(), 'Test is flaky on fedora')
|
||||
def test_issue_7754(self):
|
||||
old_cwd = os.getcwd()
|
||||
config_dir = os.path.join(TMP, 'issue-7754')
|
||||
|
|
Loading…
Add table
Reference in a new issue