mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #43341 from ixs/fedora-rh_ip
Fix rh_ip template use for Fedora
This commit is contained in:
commit
2964707e5d
@ -1013,7 +1013,10 @@ def build_interface(iface, iface_type, enabled, **settings):
|
||||
salt '*' ip.build_interface eth0 eth <settings>
|
||||
'''
|
||||
if __grains__['os'] == 'Fedora':
|
||||
rh_major = '6'
|
||||
if __grains__['osmajorrelease'] >= 18:
|
||||
rh_major = '7'
|
||||
else:
|
||||
rh_major = '6'
|
||||
else:
|
||||
rh_major = __grains__['osrelease'][:1]
|
||||
|
||||
|
@ -58,7 +58,7 @@ class RhipTestCase(TestCase, LoaderModuleMockMixin):
|
||||
'''
|
||||
Test to build an interface script for a network interface.
|
||||
'''
|
||||
with patch.dict(rh_ip.__grains__, {'os': 'Fedora'}):
|
||||
with patch.dict(rh_ip.__grains__, {'os': 'Fedora', 'osmajorrelease': 26}):
|
||||
with patch.object(rh_ip, '_raise_error_iface', return_value=None):
|
||||
|
||||
self.assertRaises(AttributeError,
|
||||
|
Loading…
Reference in New Issue
Block a user