Beispiel #1
0
 def test_interfaces(self):
     '''
     Test for return a dictionary of information about
      all the interfaces on the minion
     '''
     with patch.object(salt.utils.network, 'interfaces', return_value={}):
         self.assertDictEqual(network.interfaces(), {})
Beispiel #2
0
 def test_interfaces(self):
     '''
     Test for return a dictionary of information about
      all the interfaces on the minion
     '''
     with patch.object(salt.utils.network, 'interfaces', return_value={}):
         self.assertDictEqual(network.interfaces(), {})
Beispiel #3
0
 def test_interfaces(self):
     """
     Test for return a dictionary of information about
      all the interfaces on the minion
     """
     with patch.dict(network.__utils__,
                     {"network.interfaces": MagicMock(return_value={})}):
         self.assertDictEqual(network.interfaces(), {})
Beispiel #4
0
def lb_iptables():
    hw_addrs=[]
    for i in salt_network.interfaces().keys():
        if i.startswith('eth'):
	    hw_addrs.append(salt_network.hw_addr(i))
    return {'hw_addrs':hw_addrs}