Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GNS3_unikernel_testbed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NGUYEN Do Duc Anh
GNS3_unikernel_testbed
Commits
6661f6b6
Commit
6661f6b6
authored
7 months ago
by
NGUYEN Do Duc Anh
Browse files
Options
Downloads
Patches
Plain Diff
check error code
parent
14f437da
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ubuntu_base/opportunistic_node.py
+10
-3
10 additions, 3 deletions
ubuntu_base/opportunistic_node.py
with
10 additions
and
3 deletions
ubuntu_base/opportunistic_node.py
+
10
−
3
View file @
6661f6b6
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment