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
2436e476
Commit
2436e476
authored
Jul 22, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some debugging msgs, and a small fix
parent
925ec4af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
src/netns/node.py
src/netns/node.py
+7
-3
No files found.
src/netns/node.py
View file @
2436e476
...
@@ -23,6 +23,7 @@ class Node(object):
...
@@ -23,6 +23,7 @@ class Node(object):
communication protocol are printed on stderr."""
communication protocol are printed on stderr."""
fd
,
pid
=
_start_child
(
debug
,
nonetns
)
fd
,
pid
=
_start_child
(
debug
,
nonetns
)
self
.
_pid
=
pid
self
.
_pid
=
pid
self
.
_debug
=
debug
self
.
_slave
=
netns
.
protocol
.
Client
(
fd
,
fd
,
debug
)
self
.
_slave
=
netns
.
protocol
.
Client
(
fd
,
fd
,
debug
)
self
.
_processes
=
weakref
.
WeakValueDictionary
()
self
.
_processes
=
weakref
.
WeakValueDictionary
()
self
.
_interfaces
=
weakref
.
WeakValueDictionary
()
self
.
_interfaces
=
weakref
.
WeakValueDictionary
()
...
@@ -31,10 +32,12 @@ class Node(object):
...
@@ -31,10 +32,12 @@ class Node(object):
Node
.
_nextnode
+=
1
Node
.
_nextnode
+=
1
def
__del__
(
self
):
def
__del__
(
self
):
if
self
.
_debug
:
# pragma: no cover
sys
.
stderr
.
write
(
"*** Node(%s) __del__
\
n
"
%
self
.
pid
)
self
.
destroy
()
self
.
destroy
()
def
destroy
(
self
):
def
destroy
(
self
):
if
self
.
debug
:
# pragma: no cover
if
self
.
_
debug
:
# pragma: no cover
sys
.
stderr
.
write
(
"*** Node(%s) destroy
\
n
"
%
self
.
pid
)
sys
.
stderr
.
write
(
"*** Node(%s) destroy
\
n
"
%
self
.
pid
)
for
p
in
self
.
_processes
.
values
():
for
p
in
self
.
_processes
.
values
():
p
.
destroy
()
p
.
destroy
()
...
@@ -94,8 +97,9 @@ class Node(object):
...
@@ -94,8 +97,9 @@ class Node(object):
else
:
else
:
ret
.
append
(
self
.
_interfaces
[
i
])
ret
.
append
(
self
.
_interfaces
[
i
])
# by the way, clean up _interfaces
# by the way, clean up _interfaces
for
i
in
self
.
_interfaces
:
for
i
in
list
(
self
.
_interfaces
):
# copy before deleting!
if
i
not
in
ifaces
:
if
i
not
in
ifaces
:
if
self
.
_debug
:
sys
.
stderr
.
write
(
"WARNING: interface #%d went away."
%
i
)
sys
.
stderr
.
write
(
"WARNING: interface #%d went away."
%
i
)
del
self
.
_interfaces
[
i
]
del
self
.
_interfaces
[
i
]
...
...
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