@@ -181,6 +181,7 @@ def mac(debug=False):
181181 print (str (e ))
182182 return GENERAL_ERROR_MESSAGE
183183
184+
184185def network_control (command , device = "eth0" , debug = False ):
185186 """
186187 Control network adaptor.
@@ -198,7 +199,7 @@ def network_control(command, device="eth0", debug=False):
198199 if command == "down" :
199200 cmd = "down"
200201 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 )
202203 if len (output [0 ]) == 0 and len (output [1 ]) == 0 :
203204 return True
204205 return False
@@ -207,6 +208,7 @@ def network_control(command, device="eth0", debug=False):
207208 print (str (e ))
208209 return GENERAL_ERROR_MESSAGE
209210
211+
210212def network_enable (device = "eth0" , debug = False ):
211213 """
212214 Shortcut to enable network adaptor.
@@ -217,7 +219,8 @@ def network_enable(device="eth0", debug=False):
217219 :type debug:bool
218220 :return: True in successful and False otherwise
219221 """
220- return network_control ("up" ,device = device ,debug = debug )
222+ return network_control ("up" , device = device , debug = debug )
223+
221224
222225def network_disable (device = "eth0" , debug = False ):
223226 """
0 commit comments