mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #52250 from twangboy/fix_grains
Fix the domain grain on Windows
This commit is contained in:
commit
e5a755d45d
2 changed files with 28 additions and 0 deletions
|
@ -2066,6 +2066,12 @@ def locale_info():
|
|||
def hostname():
|
||||
'''
|
||||
Return fqdn, hostname, domainname
|
||||
|
||||
.. note::
|
||||
On Windows the ``domain`` grain may refer to the dns entry for the host
|
||||
instead of the Windows domain to which the host is joined. It may also
|
||||
be empty if not a part of any domain. Refer to the ``windowsdomain``
|
||||
grain instead
|
||||
'''
|
||||
# This is going to need some work
|
||||
# Provides:
|
||||
|
|
|
@ -133,6 +133,28 @@ class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
|||
os_release = core._parse_os_release('/etc/os-release', '/usr/lib/os-release')
|
||||
self.assertEqual(os_release, {})
|
||||
|
||||
@skipIf(not salt.utils.platform.is_windows(), 'System is not Windows')
|
||||
def test__windows_platform_data(self):
|
||||
grains = core._windows_platform_data()
|
||||
keys = ['biosversion',
|
||||
'osrelease',
|
||||
'domain',
|
||||
'kernelrelease',
|
||||
'motherboard',
|
||||
'serialnumber',
|
||||
'timezone',
|
||||
'manufacturer',
|
||||
'kernelversion',
|
||||
'osservicepack',
|
||||
'virtual',
|
||||
'productname',
|
||||
'osfullname',
|
||||
'osmanufacturer',
|
||||
'osversion',
|
||||
'windowsdomain']
|
||||
for key in keys:
|
||||
self.assertIn(key, grains)
|
||||
|
||||
@skipIf(not salt.utils.platform.is_linux(), 'System is not Linux')
|
||||
def test_gnu_slash_linux_in_os_name(self):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue