diff --git a/salt/modules/debian_ip.py b/salt/modules/debian_ip.py index 39ceda5478..fe36451c26 100644 --- a/salt/modules/debian_ip.py +++ b/salt/modules/debian_ip.py @@ -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() diff --git a/tests/unit/modules/test_debian_ip.py b/tests/unit/modules/test_debian_ip.py index a49cda9f70..ff7d5366e2 100644 --- a/tests/unit/modules/test_debian_ip.py +++ b/tests/unit/modules/test_debian_ip.py @@ -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'))