MCPcopy Index your code
hub / github.com/SpaceNetLab/StarryNet / sn_del_link

Function sn_del_link

starrynet/sn_utils.py:871–887  ·  view source on GitHub ↗
(first_index, second_index, container_id_list, remote_ssh)

Source from the content-addressed store, hash-verified

869
870
871def sn_del_link(first_index, second_index, container_id_list, remote_ssh):
872 sn_remote_cmd(
873 remote_ssh, "docker exec -d " +
874 str(container_id_list[second_index - 1]) + " ip link set dev B" +
875 str(second_index) + "-eth" + str(first_index) + " down")
876 sn_remote_cmd(
877 remote_ssh, "docker exec -d " +
878 str(container_id_list[first_index - 1]) + " ip link set dev B" +
879 str(first_index) + "-eth" + str(second_index) + " down")
880 GSL_name = "GSL_" + str(first_index) + "-" + str(second_index)
881 sn_remote_cmd(
882 remote_ssh, 'docker network disconnect ' + GSL_name + " " +
883 str(container_id_list[first_index - 1]))
884 sn_remote_cmd(
885 remote_ssh, 'docker network disconnect ' + GSL_name + " " +
886 str(container_id_list[second_index - 1]))
887 sn_remote_cmd(remote_ssh, 'docker network rm ' + GSL_name)
888
889
890# A thread designed for stopping the emulation.

Callers 1

runMethod · 0.85

Calls 1

sn_remote_cmdFunction · 0.85

Tested by

no test coverage detected