Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemu3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
nemu3
Commits
21c4a309
Commit
21c4a309
authored
May 20, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hooks
parent
82872311
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
sample-api.py
sample-api.py
+7
-0
No files found.
sample-api.py
View file @
21c4a309
#/usr/bin/env python
# vim:ts=4:sw=4:et:ai:sts=4
import
netns
import
signal
# run_as: user to setuid() to before running applications (this is assumed to
# roon as root)
netns
.
config
.
run_as
=
'nobody'
# Clean-up is essential to avoid leaving bridge devices all over the place
# (luckily, the veths die automatically). This installs signals and exit
# handlers.
netns
.
set_cleanup_hooks
(
on_exit
=
True
,
on_signals
=
[
signal
.
SIGTERM
,
signal
.
SIGINT
])
# each Node is a netns
a
=
netns
.
Node
()
b
=
netns
.
Node
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment