@@ -181,6 +181,7 @@ def mac(debug=False):
181
181
print (str (e ))
182
182
return GENERAL_ERROR_MESSAGE
183
183
184
+
184
185
def network_control (command , device = "eth0" , debug = False ):
185
186
"""
186
187
Control network adaptor.
@@ -198,7 +199,7 @@ def network_control(command, device="eth0", debug=False):
198
199
if command == "down" :
199
200
cmd = "down"
200
201
output = sub .Popen (["ifconfig" , device , cmd ],
201
- stderr = sub .PIPE , stdin = sub .PIPE , stdout = sub .PIPE )
202
+ stderr = sub .PIPE , stdin = sub .PIPE , stdout = sub .PIPE )
202
203
if len (output [0 ]) == 0 and len (output [1 ]) == 0 :
203
204
return True
204
205
return False
@@ -207,6 +208,7 @@ def network_control(command, device="eth0", debug=False):
207
208
print (str (e ))
208
209
return GENERAL_ERROR_MESSAGE
209
210
211
+
210
212
def network_enable (device = "eth0" , debug = False ):
211
213
"""
212
214
Shortcut to enable network adaptor.
@@ -217,7 +219,8 @@ def network_enable(device="eth0", debug=False):
217
219
:type debug:bool
218
220
:return: True in successful and False otherwise
219
221
"""
220
- return network_control ("up" ,device = device ,debug = debug )
222
+ return network_control ("up" , device = device , debug = debug )
223
+
221
224
222
225
def network_disable (device = "eth0" , debug = False ):
223
226
"""
0 commit comments