summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Roma <aroma@mirantis.com>2016-06-03 13:31:24 +0000
committerArtem Roma <aroma@mirantis.com>2016-06-03 13:31:24 +0000
commit041e3ce2c1a3b711aac806d972164971f26a3f17 (patch)
treebca749322fff5ee8aa716713396d15129438b177
parent6505d38c66fddcc2e569d549bc5f7094cc9529f9 (diff)
Revert "Add possibility to run dhcp discover without VLANS"
Notes
Notes (review): Code-Review+1: Maksim Malchuk <mmalchuk@mirantis.com> Code-Review+1: Aleksandr Didenko <adidenko@mirantis.com> Code-Review+2: Aleksey Kasatkin <akasatkin@mirantis.com> Workflow+1: Aleksey Kasatkin <akasatkin@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 03 Jun 2016 14:04:04 +0000 Reviewed-on: https://review.openstack.org/325296 Project: openstack/network-checker Branch: refs/heads/master
-rw-r--r--dhcp_checker/api.py36
-rw-r--r--dhcp_checker/commands.py9
-rw-r--r--dhcp_checker/tests/system/tests.py18
-rw-r--r--dhcp_checker/tests/unit/test_api.py66
-rw-r--r--dhcp_checker/tests/unit/test_commands.py7
-rw-r--r--dhcp_checker/tests/unit/test_utils.py12
-rw-r--r--dhcp_checker/utils.py45
-rw-r--r--setup.py4
8 files changed, 63 insertions, 134 deletions
diff --git a/dhcp_checker/api.py b/dhcp_checker/api.py
index 51e4e31..e85e933 100644
--- a/dhcp_checker/api.py
+++ b/dhcp_checker/api.py
@@ -107,42 +107,24 @@ def make_listeners(ifaces):
107 107
108 108
109@utils.filter_duplicated_results 109@utils.filter_duplicated_results
110def check_dhcp_with_vlans(config, timeout=5, repeat=2, w_vlans=True): 110def check_dhcp_with_vlans(config, timeout=5, repeat=2):
111 """Provide config of {iface: [vlans..]} pairs 111 """Provide config of {iface: [vlans..]} pairs
112 112
113 @config - {'eth0': (100, 101), 'eth1': (100, 102)} 113 @config - {'eth0': (100, 101), 'eth1': (100, 102)}
114
115 'w_vlans' flag toggles dhcp discover check for tagged interfaces;
116 if it is False - the request will be sent only for real interfaces
117
118 Before the request is sent interfaces are set (if they haven't been before)
119 and after - down-ed (only those up-ed for the purpose of this checking)
120
121 If the flag 'w_vlans' holds True but list of vlans for iface is [0],
122 the check will also be performed only for real interfaces (see logic of
123 utils.VlansContext context manager)
124 """ 114 """
125 # vifaces - list of pairs ('eth0', ['eth0.100', 'eth0.101']) 115 # vifaces - list of pairs ('eth0', ['eth0.100', 'eth0.101'])
126 with utils.VlansContext(config) as vifaces: 116 with utils.VlansContext(config) as vifaces:
127 ifaces, vlans = zip(*vifaces) 117 ifaces, vlans = zip(*vifaces)
118 listeners = make_listeners(ifaces)
128 119
129 # up interfaces before making the check 120 for _ in xrange(repeat):
130 with utils.IfaceState(ifaces) as rdy_ifaces: 121 for i in utils.filtered_ifaces(itertools.chain(ifaces, *vlans)):
131 listeners = make_listeners(rdy_ifaces) 122 send_dhcp_discover(i)
132 123 time.sleep(timeout)
133 for _ in xrange(repeat):
134 ifaces_to_check = (
135 itertools.chain(rdy_ifaces, *vlans)
136 if w_vlans else rdy_ifaces
137 )
138
139 for i in utils.filtered_ifaces(ifaces_to_check):
140 send_dhcp_discover(i)
141 time.sleep(timeout)
142 124
143 for l in listeners: 125 for l in listeners:
144 for pkt in l.readpkts(): 126 for pkt in l.readpkts():
145 yield utils.format_answer(scapy.Ether(pkt[1]), l.name) 127 yield utils.format_answer(scapy.Ether(pkt[1]), l.name)
146 128
147 129
148@utils.single_format 130@utils.single_format
diff --git a/dhcp_checker/commands.py b/dhcp_checker/commands.py
index 0d1c013..161af8d 100644
--- a/dhcp_checker/commands.py
+++ b/dhcp_checker/commands.py
@@ -92,25 +92,22 @@ class ListDhcpAssignment(lister.Lister, BaseCommand):
92 return columns, [first.values()] + [item.values() for item in res] 92 return columns, [first.values()] + [item.values() for item in res]
93 93
94 94
95class DhcpCheckDiscover(lister.Lister, BaseCommand): 95class DhcpWithVlansCheck(lister.Lister, BaseCommand):
96 """Provide iface with list of vlans to check 96 """Provide iface with list of vlans to check
97 97
98 If no vlans created - they will be. After creation they won't be deleted. 98 If no vlans created - they will be. After creation they won't be deleted.
99 """ 99 """
100 100
101 def get_parser(self, prog_name): 101 def get_parser(self, prog_name):
102 parser = super(DhcpCheckDiscover, self).get_parser(prog_name) 102 parser = super(DhcpWithVlansCheck, self).get_parser(prog_name)
103 parser.add_argument('config', 103 parser.add_argument('config',
104 help='Ethernet interface name') 104 help='Ethernet interface name')
105 parser.add_argument('--with-vlans', action='store_true',
106 help='Enable the check for tagged ifaces')
107 return parser 105 return parser
108 106
109 def take_action(self, parsed_args): 107 def take_action(self, parsed_args):
110 res = list(api.check_dhcp_with_vlans(json.loads(parsed_args.config), 108 res = list(api.check_dhcp_with_vlans(json.loads(parsed_args.config),
111 timeout=parsed_args.timeout, 109 timeout=parsed_args.timeout,
112 repeat=parsed_args.repeat, 110 repeat=parsed_args.repeat))
113 w_vlans=parsed_args.with_vlans))
114 if not res: 111 if not res:
115 res = [{}] 112 res = [{}]
116 return (utils.DHCP_OFFER_COLUMNS, 113 return (utils.DHCP_OFFER_COLUMNS,
diff --git a/dhcp_checker/tests/system/tests.py b/dhcp_checker/tests/system/tests.py
index f6b2788..97521e4 100644
--- a/dhcp_checker/tests/system/tests.py
+++ b/dhcp_checker/tests/system/tests.py
@@ -70,9 +70,9 @@ class TestDhcpWithNetworkDown(unittest.TestCase):
70 70
71 def test_dhcp_server_on_eth2_down(self): 71 def test_dhcp_server_on_eth2_down(self):
72 """iface should be ifuped in case it's down and rolledback after""" 72 """iface should be ifuped in case it's down and rolledback after"""
73 manager = utils.IfaceState([self.iface_down]) 73 manager = utils.IfaceState(self.iface_down)
74 with manager as ifaces: 74 with manager as iface:
75 response = api.check_dhcp_on_eth(ifaces[0], 2) 75 response = api.check_dhcp_on_eth(iface, 2)
76 76
77 self.assertEqual(len(response), 1) 77 self.assertEqual(len(response), 1)
78 self.assertTrue(response[0]['server_ip']) 78 self.assertTrue(response[0]['server_ip'])
@@ -82,9 +82,9 @@ class TestDhcpWithNetworkDown(unittest.TestCase):
82 82
83 def test_dhcp_server_on_eth0_up(self): 83 def test_dhcp_server_on_eth0_up(self):
84 """Test verifies that if iface is up, it won't be touched""" 84 """Test verifies that if iface is up, it won't be touched"""
85 manager = utils.IfaceState([self.iface_up]) 85 manager = utils.IfaceState(self.iface_up)
86 with manager as ifaces: 86 with manager as iface:
87 response = api.check_dhcp_on_eth(ifaces[0], 2) 87 response = api.check_dhcp_on_eth(iface, 2)
88 88
89 self.assertEqual(len(response), 1) 89 self.assertEqual(len(response), 1)
90 self.assertTrue(response[0]['server_ip']) 90 self.assertTrue(response[0]['server_ip'])
@@ -95,9 +95,9 @@ class TestDhcpWithNetworkDown(unittest.TestCase):
95 def test_dhcp_server_on_nonexistent_iface(self): 95 def test_dhcp_server_on_nonexistent_iface(self):
96 96
97 def test_check(): 97 def test_check():
98 manager = utils.IfaceState(['eth10']) 98 manager = utils.IfaceState('eth10')
99 with manager as ifaces: 99 with manager as iface:
100 api.check_dhcp_on_eth(ifaces[0], 2) 100 api.check_dhcp_on_eth(iface, 2)
101 self.assertRaises(EnvironmentError, test_check) 101 self.assertRaises(EnvironmentError, test_check)
102 102
103 def tearDown(self): 103 def tearDown(self):
diff --git a/dhcp_checker/tests/unit/test_api.py b/dhcp_checker/tests/unit/test_api.py
index 1316ae4..1d284b5 100644
--- a/dhcp_checker/tests/unit/test_api.py
+++ b/dhcp_checker/tests/unit/test_api.py
@@ -45,23 +45,6 @@ expected_response = {
45} 45}
46 46
47 47
48class IfaceStateMock(object):
49
50 def __init__(self, ifaces):
51 self.ifaces = ifaces
52
53 def __enter__(self):
54 return self.ifaces
55
56 def __exit__(self, exc_type, exc_val, ex_tb):
57 pass
58
59
60def filtered_ifaces_mock(ifaces):
61 return ifaces
62
63
64@patch('dhcp_checker.utils.IfaceState', new=IfaceStateMock)
65class TestDhcpApi(unittest.TestCase): 48class TestDhcpApi(unittest.TestCase):
66 49
67 def setUp(self): 50 def setUp(self):
@@ -70,14 +53,9 @@ class TestDhcpApi(unittest.TestCase):
70 'dhcp.pcap'))) 53 'dhcp.pcap')))
71 self.dhcp_response = self.scapy_data[1:] 54 self.dhcp_response = self.scapy_data[1:]
72 55
73 self.config_sample = {
74 'eth0': (100, 101),
75 'eth1': (100, 102)
76 }
77
78 @patch('dhcp_checker.api.scapy.srp') 56 @patch('dhcp_checker.api.scapy.srp')
79 @patch('dhcp_checker.api.scapy.get_if_raw_hwaddr') 57 @patch('dhcp_checker.api.scapy.get_if_raw_hwaddr')
80 def test_check_dhcp_on_eth(self, raw_hwaddr, srp_mock, *_): 58 def test_check_dhcp_on_eth(self, raw_hwaddr, srp_mock):
81 raw_hwaddr.return_value = ('111', '222') 59 raw_hwaddr.return_value = ('111', '222')
82 srp_mock.return_value = ([self.dhcp_response], []) 60 srp_mock.return_value = ([self.dhcp_response], [])
83 response = api.check_dhcp_on_eth('eth1', timeout=5) 61 response = api.check_dhcp_on_eth('eth1', timeout=5)
@@ -85,53 +63,36 @@ class TestDhcpApi(unittest.TestCase):
85 63
86 @patch('dhcp_checker.api.scapy.srp') 64 @patch('dhcp_checker.api.scapy.srp')
87 @patch('dhcp_checker.api.scapy.get_if_raw_hwaddr') 65 @patch('dhcp_checker.api.scapy.get_if_raw_hwaddr')
88 def test_check_dhcp_on_eth_empty_response(self, raw_hwaddr, srp_mock, *_): 66 def test_check_dhcp_on_eth_empty_response(self, raw_hwaddr, srp_mock):
89 raw_hwaddr.return_value = ('111', '222') 67 raw_hwaddr.return_value = ('111', '222')
90 srp_mock.return_value = ([], []) 68 srp_mock.return_value = ([], [])
91 response = api.check_dhcp_on_eth('eth1', timeout=5) 69 response = api.check_dhcp_on_eth('eth1', timeout=5)
92 self.assertEqual([], response) 70 self.assertEqual([], response)
93 71
94 @patch('dhcp_checker.utils.filtered_ifaces')
95 @patch('dhcp_checker.api.send_dhcp_discover') 72 @patch('dhcp_checker.api.send_dhcp_discover')
96 @patch('dhcp_checker.api.make_listeners') 73 @patch('dhcp_checker.api.make_listeners')
97 def test_check_dhcp_with_multiple_ifaces( 74 def test_check_dhcp_with_multiple_ifaces(
98 self, make_listeners, send_discover, filtered_ifaces, *_): 75 self, make_listeners, send_discover):
99 repeat = 1 76 api.check_dhcp(['eth1', 'eth2'], repeat=1)
100 ifaces = ['eth1', 'eth2']
101
102 filtered_ifaces.return_value = ifaces
103
104 api.check_dhcp(ifaces, repeat=repeat)
105
106 make_listeners.assert_called_once_with(('eth2', 'eth1')) 77 make_listeners.assert_called_once_with(('eth2', 'eth1'))
107 self.assertEqual(filtered_ifaces.call_count, repeat)
108 self.assertEqual(send_discover.call_count, 2) 78 self.assertEqual(send_discover.call_count, 2)
109 79
110 @patch('dhcp_checker.utils.filtered_ifaces', new=filtered_ifaces_mock)
111 @patch('dhcp_checker.api.send_dhcp_discover') 80 @patch('dhcp_checker.api.send_dhcp_discover')
112 @patch('dhcp_checker.api.make_listeners') 81 @patch('dhcp_checker.api.make_listeners')
113 def test_check_dhcp_with_vlans(self, make_listeners, send_discover, *_): 82 def test_check_dhcp_with_vlans(self, make_listeners, send_discover):
114 83 config_sample = {
115 api.check_dhcp_with_vlans(self.config_sample, timeout=1, repeat=1, 84 'eth0': (100, 101),
116 w_vlans=True) 85 'eth1': (100, 102)
86 }
87 api.check_dhcp_with_vlans(config_sample, timeout=1)
117 make_listeners.assert_called_once_with(('eth1', 'eth0')) 88 make_listeners.assert_called_once_with(('eth1', 'eth0'))
118 self.assertEqual(send_discover.call_count, 6) 89 self.assertEqual(send_discover.call_count, 6)
119 90
120 @patch('dhcp_checker.utils.filtered_ifaces', new=filtered_ifaces_mock)
121 @patch('dhcp_checker.api.send_dhcp_discover')
122 @patch('dhcp_checker.api.make_listeners')
123 def test_check_dhcp_wo_vlans(self, make_listeners, send_discover, *_):
124 api.check_dhcp_with_vlans(self.config_sample, timeout=1, repeat=1,
125 w_vlans=False)
126 make_listeners.assert_called_once_with(('eth1', 'eth0'))
127 self.assertEqual(send_discover.call_count, 2)
128
129 @patch('dhcp_checker.utils.filtered_ifaces', new=filtered_ifaces_mock)
130 @patch('dhcp_checker.api.time.sleep') 91 @patch('dhcp_checker.api.time.sleep')
131 @patch('dhcp_checker.api.send_dhcp_discover') 92 @patch('dhcp_checker.api.send_dhcp_discover')
132 @patch('dhcp_checker.api.make_listeners') 93 @patch('dhcp_checker.api.make_listeners')
133 def test_check_dhcp_with_vlans_repeat_2(self, make_listeners, 94 def test_check_dhcp_with_vlans_repeat_2(self, make_listeners,
134 send_discover, sleep_mock, *_): 95 send_discover, sleep_mock):
135 config_sample = { 96 config_sample = {
136 'eth0': (), 97 'eth0': (),
137 } 98 }
@@ -140,13 +101,12 @@ class TestDhcpApi(unittest.TestCase):
140 make_listeners.assert_called_once_with(('eth0',)) 101 make_listeners.assert_called_once_with(('eth0',))
141 self.assertEqual(send_discover.call_count, 3) 102 self.assertEqual(send_discover.call_count, 3)
142 103
143 @patch('dhcp_checker.utils.filtered_ifaces') 104 @patch('dhcp_checker.api.utils.filtered_ifaces')
144 @patch('dhcp_checker.api.get_ifaces_exclude_lo') 105 @patch('dhcp_checker.api.get_ifaces_exclude_lo')
145 @patch('dhcp_checker.api.send_dhcp_discover') 106 @patch('dhcp_checker.api.send_dhcp_discover')
146 @patch('dhcp_checker.api.make_listeners') 107 @patch('dhcp_checker.api.make_listeners')
147 def test_check_dhcp_with_no_ifaces( 108 def test_check_dhcp_with_no_ifaces(
148 self, make_listeners, send_discover, interfaces, 109 self, make_listeners, send_discover, interfaces, filtered_ifaces):
149 filtered_ifaces, *_):
150 interfaces.return_value = ['eth1'] 110 interfaces.return_value = ['eth1']
151 filtered_ifaces.return_value = ['eth1'] 111 filtered_ifaces.return_value = ['eth1']
152 api.check_dhcp(None, timeout=1, repeat=2) 112 api.check_dhcp(None, timeout=1, repeat=2)
diff --git a/dhcp_checker/tests/unit/test_commands.py b/dhcp_checker/tests/unit/test_commands.py
index 0af2dd8..346d843 100644
--- a/dhcp_checker/tests/unit/test_commands.py
+++ b/dhcp_checker/tests/unit/test_commands.py
@@ -37,7 +37,7 @@ class TestCommandsInterface(unittest.TestCase):
37 37
38 def test_list_dhcp_servers(self, api): 38 def test_list_dhcp_servers(self, api):
39 api.check_dhcp.return_value = iter([expected_response]) 39 api.check_dhcp.return_value = iter([expected_response])
40 command = cli.main(['listservers', '--ifaces', 'eth0', 'eth1', 40 command = cli.main(['discover', '--ifaces', 'eth0', 'eth1',
41 '--format', 'json']) 41 '--format', 'json'])
42 self.assertEqual(command, 0) 42 self.assertEqual(command, 0)
43 api.check_dhcp.assert_called_once_with(['eth0', 'eth1'], 43 api.check_dhcp.assert_called_once_with(['eth0', 'eth1'],
@@ -57,8 +57,7 @@ class TestCommandsInterface(unittest.TestCase):
57 config_sample = {'eth1': ['100', '101'], 57 config_sample = {'eth1': ['100', '101'],
58 'eth2': range(103, 110)} 58 'eth2': range(103, 110)}
59 api.check_dhcp_with_vlans.return_value = iter([expected_response]) 59 api.check_dhcp_with_vlans.return_value = iter([expected_response])
60 command = cli.main(['discover', json.dumps(config_sample), 60 command = cli.main(['vlans', json.dumps(config_sample)])
61 '--with-vlans'])
62 self.assertEqual(command, 0) 61 self.assertEqual(command, 0)
63 api.check_dhcp_with_vlans.assert_called_once_with( 62 api.check_dhcp_with_vlans.assert_called_once_with(
64 config_sample, repeat=2, timeout=5, w_vlans=True) 63 config_sample, repeat=2, timeout=5)
diff --git a/dhcp_checker/tests/unit/test_utils.py b/dhcp_checker/tests/unit/test_utils.py
index e0d4e8a..62ccc5e 100644
--- a/dhcp_checker/tests/unit/test_utils.py
+++ b/dhcp_checker/tests/unit/test_utils.py
@@ -156,16 +156,16 @@ class TestIfaceStateHelper(unittest.TestCase):
156 def test_iface_is_up(self, command, iface_state): 156 def test_iface_is_up(self, command, iface_state):
157 iface_value = iter(('UP',) * 3) 157 iface_value = iter(('UP',) * 3)
158 iface_state.side_effect = lambda *args, **kwargs: next(iface_value) 158 iface_state.side_effect = lambda *args, **kwargs: next(iface_value)
159 with utils.IfaceState(['eth1']) as ifaces: 159 with utils.IfaceState('eth1') as iface:
160 self.assertEqual(ifaces[0], 'eth1') 160 self.assertEqual(iface, 'eth1')
161 self.assertEqual(iface_state.call_count, 2) 161 self.assertEqual(iface_state.call_count, 2)
162 self.assertEqual(command.call_count, 0) 162 self.assertEqual(command.call_count, 0)
163 163
164 def test_iface_is_down(self, command, iface_state): 164 def test_iface_is_down(self, command, iface_state):
165 iface_value = iter(('DOWN', 'UP', 'DOWN')) 165 iface_value = iter(('DOWN', 'UP', 'DOWN'))
166 iface_state.side_effect = lambda *args, **kwargs: next(iface_value) 166 iface_state.side_effect = lambda *args, **kwargs: next(iface_value)
167 with utils.IfaceState(['eth1']) as ifaces: 167 with utils.IfaceState('eth1') as iface:
168 self.assertEqual(ifaces[0], 'eth1') 168 self.assertEqual(iface, 'eth1')
169 self.assertEqual(iface_state.call_count, 3) 169 self.assertEqual(iface_state.call_count, 3)
170 self.assertEqual(command.call_count, 2) 170 self.assertEqual(command.call_count, 2)
171 self.assertEqual(command.call_args_list, 171 self.assertEqual(command.call_args_list,
@@ -177,7 +177,7 @@ class TestIfaceStateHelper(unittest.TestCase):
177 iface_state.side_effect = lambda *args, **kwargs: next(iface_value) 177 iface_state.side_effect = lambda *args, **kwargs: next(iface_value)
178 178
179 def test_raises(): 179 def test_raises():
180 with utils.IfaceState(['eth1'], retry=4) as ifaces: 180 with utils.IfaceState('eth1', retry=4) as iface:
181 self.assertEqual(ifaces[0], 'eth1') 181 self.assertEqual(iface, 'eth1')
182 self.assertRaises(EnvironmentError, test_raises) 182 self.assertRaises(EnvironmentError, test_raises)
183 self.assertEqual(command.call_count, 4) 183 self.assertEqual(command.call_count, 4)
diff --git a/dhcp_checker/utils.py b/dhcp_checker/utils.py
index 34effa2..a38b755 100644
--- a/dhcp_checker/utils.py
+++ b/dhcp_checker/utils.py
@@ -14,7 +14,6 @@
14# with this program; if not, write to the Free Software Foundation, Inc., 14# with this program; if not, write to the Free Software Foundation, Inc.,
15# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 15# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 16
17import copy
18import functools 17import functools
19import re 18import re
20import subprocess 19import subprocess
@@ -208,41 +207,33 @@ class VlansContext(object):
208 207
209 208
210class IfaceState(object): 209class IfaceState(object):
211 """Context manager to control state of ifaces while dhcp checker runs""" 210 """Context manager to control state of iface while dhcp checker runs"""
212 211
213 def __init__(self, ifaces, rollback=True, retry=3): 212 def __init__(self, iface, rollback=True, retry=3):
214 self.rollback = rollback 213 self.rollback = rollback
215 self.retry = retry 214 self.retry = retry
216 self.ifaces = ifaces 215 self.iface = iface
217 self.pre_ifaces_state = self.get_ifaces_state() 216 self.pre_iface_state = _iface_state(iface)
218 self.ifaces_state = copy.deepcopy(self.pre_ifaces_state) 217 self.iface_state = self.pre_iface_state
219 self.post_ifaces_state = {} 218 self.post_iface_state = ''
220 219
221 def get_ifaces_state(self): 220 def iface_up(self):
222 state = {} 221 while self.retry and self.iface_state != 'UP':
223 for iface in self.ifaces: 222 command_util('ifconfig', self.iface, 'up')
224 state[iface] = _iface_state(iface) 223 self.iface_state = _iface_state(self.iface)
225 return state
226
227 def iface_up(self, iface):
228 while self.retry and self.ifaces_state[iface] != 'UP':
229 command_util('ifconfig', iface, 'up')
230 self.ifaces_state[iface] = _iface_state(iface)
231 self.retry -= 1 224 self.retry -= 1
232 if self.ifaces_state[iface] != 'UP': 225 if self.iface_state != 'UP':
233 raise EnvironmentError( 226 raise EnvironmentError(
234 'Tried my best to ifup iface {0}.'.format(iface)) 227 'Tried my best to ifup iface {0}.'.format(self.iface))
235 228
236 def __enter__(self): 229 def __enter__(self):
237 for iface in self.ifaces: 230 self.iface_up()
238 self.iface_up(iface) 231 return self.iface
239 return self.ifaces
240 232
241 def __exit__(self, exc_type, exc_val, exc_tb): 233 def __exit__(self, exc_type, exc_val, exc_tb):
242 for iface in self.ifaces: 234 if self.pre_iface_state != 'UP' and self.rollback:
243 if self.pre_ifaces_state[iface] != 'UP' and self.rollback: 235 command_util('ifconfig', self.iface, 'down')
244 command_util('ifconfig', iface, 'down') 236 self.post_iface_state = _iface_state(self.iface)
245 self.post_ifaces_state[iface] = _iface_state(iface)
246 237
247 238
248def create_mac_filter(iface): 239def create_mac_filter(iface):
diff --git a/setup.py b/setup.py
index 607b24b..0f36bdf 100644
--- a/setup.py
+++ b/setup.py
@@ -39,9 +39,9 @@ setuptools.setup(
39 'urlaccesscheck = url_access_checker.cli:main', 39 'urlaccesscheck = url_access_checker.cli:main',
40 ], 40 ],
41 'dhcp.check': [ 41 'dhcp.check': [
42 'listservers = dhcp_checker.commands:ListDhcpServers', 42 'discover = dhcp_checker.commands:ListDhcpServers',
43 'request = dhcp_checker.commands:ListDhcpAssignment', 43 'request = dhcp_checker.commands:ListDhcpAssignment',
44 'discover = dhcp_checker.commands:DhcpCheckDiscover' 44 'vlans = dhcp_checker.commands:DhcpWithVlansCheck'
45 ], 45 ],
46 'network_checker': [ 46 'network_checker': [
47 'multicast = network_checker.multicast.api:MulticastChecker', 47 'multicast = network_checker.multicast.api:MulticastChecker',