mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge branch '2017.7' into '2018.3'
Conflicts: - tests/unit/modules/test_debian_ip.py
This commit is contained in:
commit
81a3d4724a
@ -1913,9 +1913,11 @@ def get_network_settings():
|
||||
|
||||
hostname = _parse_hostname()
|
||||
domainname = _parse_domainname()
|
||||
searchdomain = _parse_searchdomain()
|
||||
|
||||
settings['hostname'] = hostname
|
||||
settings['domainname'] = domainname
|
||||
settings['searchdomain'] = searchdomain
|
||||
|
||||
else:
|
||||
settings = _parse_current_network_settings()
|
||||
|
@ -474,14 +474,17 @@ class DebianIpTestCase(TestCase, LoaderModuleMockMixin):
|
||||
patch('salt.modules.debian_ip._parse_hostname',
|
||||
MagicMock(return_value='SaltStack')), \
|
||||
patch('salt.modules.debian_ip._parse_domainname',
|
||||
MagicMock(return_value='saltstack.com')):
|
||||
MagicMock(return_value='saltstack.com')), \
|
||||
patch('salt.modules.debian_ip._parse_searchdomain',
|
||||
MagicMock(return_value='test.saltstack.com')):
|
||||
mock_avai = MagicMock(return_value=True)
|
||||
with patch.dict(debian_ip.__salt__, {'service.available': mock_avai,
|
||||
'service.status': mock_avai}):
|
||||
self.assertEqual(debian_ip.get_network_settings(),
|
||||
['NETWORKING=yes\n',
|
||||
'HOSTNAME=SaltStack\n',
|
||||
'DOMAIN=saltstack.com\n'])
|
||||
[u'NETWORKING=yes\n',
|
||||
u'HOSTNAME=SaltStack\n',
|
||||
u'DOMAIN=saltstack.com\n',
|
||||
u'SEARCH=test.saltstack.com\n'])
|
||||
|
||||
mock = MagicMock(side_effect=jinja2.exceptions.TemplateNotFound
|
||||
('error'))
|
||||
|
Loading…
Reference in New Issue
Block a user