diff --git a/salt/utils/network.py b/salt/utils/network.py index 8a6830f2c760..455190e9264f 100644 --- a/salt/utils/network.py +++ b/salt/utils/network.py @@ -56,6 +56,8 @@ _INTERFACES = {} + + def _get_interfaces(): ''' Provide a dict of the connected interfaces and their ip addresses diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py index eab44ae4596a..69a8b3eb2b2c 100644 --- a/tests/unit/grains/test_core.py +++ b/tests/unit/grains/test_core.py @@ -977,31 +977,27 @@ def test_dns_return(self): with patch.object(salt.utils.dns, 'parse_resolv', MagicMock(return_value=resolv_mock)): assert core.dns() == ret - def test_enablefqdnsFalse(self): ''' tests enable_fqdns_grains is set to False ''' - with patch.dict('salt.grains.core.__opts__', {'enable_fqdns_grains':False}): + with patch.dict('salt.grains.core.__opts__', {'enable_fqdns_grains': False}): assert core.fqdns() == {"fqdns": []} - def test_enablefqdnsTrue(self): ''' testing that grains uses network.fqdns module ''' with patch.dict('salt.grains.core.__salt__', {'network.fqdns': MagicMock(return_value="my.fake.domain")}): - with patch.dict('salt.grains.core.__opts__', {'enable_fqdns_grains':True}): + with patch.dict('salt.grains.core.__opts__', {'enable_fqdns_grains': True}): assert core.fqdns() == 'my.fake.domain' - def test_enablefqdnsNone(self): ''' testing default fqdns grains is returned when enable_fqdns_grains is None ''' - with patch.dict('salt.grains.core.__opts__', {'enable_fqdns_grains':None}): - assert core.fqdns() == {"fqdns": []} - + with patch.dict('salt.grains.core.__opts__', {'enable_fqdns_grains': None}): + assert core.fqdns() == {"fqdns": []} def test_enablefqdnswithoutpaching(self): ''' @@ -1010,7 +1006,6 @@ def test_enablefqdnswithoutpaching(self): with patch.dict('salt.grains.core.__salt__', {'network.fqdns': MagicMock(return_value="my.fake.domain")}): assert core.fqdns() == 'my.fake.domain' - @skipIf(not salt.utils.platform.is_linux(), 'System is not Linux') @patch.object(salt.utils, 'is_windows', MagicMock(return_value=False)) @patch('salt.utils.network.ip_addrs', MagicMock(return_value=['1.2.3.4', '5.6.7.8']))