mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #34322 from Ch3LL/add_grains_majorrelease_test
add osmajorrelease grain for raspbian
This commit is contained in:
commit
75aad073a9
@ -1489,6 +1489,8 @@ def os_data():
|
||||
os=grains['osfullname'],
|
||||
ver=grains['osrelease'].partition('.')[0])
|
||||
elif grains.get('osfullname') == 'Ubuntu':
|
||||
grains['osmajorrelease'] = grains['osrelease'].split('.', 1)[0]
|
||||
|
||||
grains['osfinger'] = '{os}-{ver}'.format(
|
||||
os=grains['osfullname'],
|
||||
ver=grains['osrelease'])
|
||||
@ -1498,7 +1500,7 @@ def os_data():
|
||||
grains['osfinger'] = '{os}-{ver}'.format(
|
||||
os=grains['osfullname'],
|
||||
ver=grains['osrelease'].partition('.')[0])
|
||||
elif grains.get('os') in ('FreeBSD', 'OpenBSD', 'NetBSD', 'Mac'):
|
||||
elif grains.get('os') in ('FreeBSD', 'OpenBSD', 'NetBSD', 'Mac', 'Raspbian'):
|
||||
grains['osmajorrelease'] = grains['osrelease'].split('.', 1)[0]
|
||||
|
||||
grains['osfinger'] = '{os}-{ver}'.format(
|
||||
|
@ -106,6 +106,15 @@ class TestModulesGrains(integration.ModuleCase):
|
||||
['level1:level2']),
|
||||
'foo')
|
||||
|
||||
def test_get_core_grains(self):
|
||||
'''
|
||||
test to ensure some core grains are returned
|
||||
'''
|
||||
grains = ['os', 'os_family', 'osmajorrelease', 'osrelease', 'osfullname', 'id']
|
||||
for grain in grains:
|
||||
get_grain = self.run_function('grains.get', [grain])
|
||||
self.assertTrue(get_grain, grain + "is not available")
|
||||
|
||||
|
||||
class GrainsAppendTestCase(integration.ModuleCase):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user