Skip to content
Snippets Groups Projects
Commit 6661f6b6 authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

check error code

parent 14f437da
Branches
No related tags found
No related merge requests found
...@@ -15,9 +15,16 @@ map_firewall = {} ...@@ -15,9 +15,16 @@ map_firewall = {}
def setup_firewall(inter_num): def setup_firewall(inter_num):
subprocess.run( try:
[f'{DIR}/ubuntu_base/configure_bridge_firewall', f"public{inter_num}", f"private{inter_num}", f"ens{inter_num}", f"br{inter_num}", f"{inter_num}", DIR], subprocess.run(
check=True) [f'{DIR}/ubuntu_base/configure_bridge_firewall', f"public{inter_num}", f"private{inter_num}", f"ens{inter_num}", f"br{inter_num}", f"{inter_num}", DIR],
check=True)
except subprocess.CalledProcessError as e:
# This will run if the command returns a non-zero exit code (i.e., an error)
print(f"Error: {e}")
print(f"Return code: {e.returncode}") # The exit code
print(f"Command output: {e.output}") # Any output (stdout/stderr)
def process_packet(new_packet): def process_packet(new_packet):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment