Small bugs
This commit is contained in:
@@ -44,18 +44,28 @@ def get_int(net_name):
|
||||
|
||||
def create_vswitch_int(net_int):
|
||||
cmd="ovs-vsctl add-br "+net_int
|
||||
subprocess.call(cmd, shell=True)
|
||||
out = subprocess.call(cmd, shell=True)
|
||||
if out2 != 0:
|
||||
raise Exception("Error on creating interface")
|
||||
|
||||
|
||||
def delete_network(net_name,net_int):
|
||||
cmd = "ovs-vsctl del-br "+net_int
|
||||
subprocess.call(cmd, shell=True)
|
||||
network = conn.networkLookupByName(net_name) #Lapin
|
||||
out = subprocess.call(cmd, shell=True)
|
||||
if out != 0:
|
||||
raise Exception("Error deleting interface")
|
||||
network = conn.networkLookupByName(net_name)
|
||||
network.destroy()
|
||||
network.undefine()
|
||||
cmd2="kill $(cat /run/dhypecp_"+net_int+".pid)"
|
||||
subprocess.call(cmd2, shell=True)
|
||||
out2 = subprocess.call(cmd2, shell=True)
|
||||
if out2 != 0:
|
||||
raise Exception("Error on killing DHCP process")
|
||||
cmd3="rm -f /run/dhypecp_"+net_int+".pid"
|
||||
subprocess.call(cmd3, shell=True)
|
||||
out3 = subprocess.call(cmd3, shell=True)
|
||||
if out3 != 0:
|
||||
raise Exception("Error on Deleting DHCP process")
|
||||
|
||||
|
||||
def create_network(net_name,net_int):
|
||||
create_vswitch_int(net_int)
|
||||
|
||||
Reference in New Issue
Block a user