mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
add osmajorrelease grain for raspbian
This commit is contained in:
parent
1398b1c51e
commit
2fc3e8a54b
@ -1498,7 +1498,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(
|
||||
|
@ -105,6 +105,14 @@ class TestModulesGrains(integration.ModuleCase):
|
||||
'grains.get',
|
||||
['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