Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
76e476dc
Commit
76e476dc
authored
Sep 17, 2017
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up logging of command lines for easier cutpaste.
parent
498f9614
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
mitogen/master.py
mitogen/master.py
+14
-4
mitogen/ssh.py
mitogen/ssh.py
+1
-1
No files found.
mitogen/master.py
View file @
76e476dc
...
...
@@ -4,6 +4,7 @@ starting new contexts via SSH. Its size is also restricted, since it must be
sent to any context that will be used to establish additional child contexts.
"""
import
commands
import
errno
import
getpass
import
imp
...
...
@@ -55,6 +56,15 @@ def get_child_modules(path, fullname):
return
[
'%s.%s'
%
(
fullname
,
name
)
for
_
,
name
,
_
in
it
]
def
format_cmdline
(
args
):
return
' '
.
join
(
commands
.
mkarg
(
arg
).
strip
()
if
any
(
s
in
arg
for
s
in
(
" '
\
"
$"
))
else
arg
for
arg
in
args
)
def
create_child
(
*
args
):
"""Create a child process whose stdin/stdout is connected to a socket,
returning `(pid, socket_obj)`."""
...
...
@@ -69,8 +79,8 @@ def create_child(*args):
raise
SystemExit
childfp
.
close
()
LOG
.
debug
(
'create_child() child %d fd %d, parent %d,
args %r
'
,
pid
,
parentfp
.
fileno
(),
os
.
getpid
(),
args
)
LOG
.
debug
(
'create_child() child %d fd %d, parent %d,
cmd: %s
'
,
pid
,
parentfp
.
fileno
(),
os
.
getpid
(),
format_cmdline
(
args
)
)
return
pid
,
os
.
dup
(
parentfp
.
fileno
())
...
...
@@ -141,8 +151,8 @@ def tty_create_child(*args):
raise
SystemExit
os
.
close
(
slave_fd
)
LOG
.
debug
(
'tty_create_child() child %d fd %d, parent %d,
args %r
'
,
pid
,
master_fd
,
os
.
getpid
(),
args
)
LOG
.
debug
(
'tty_create_child() child %d fd %d, parent %d,
cmd: %s
'
,
pid
,
master_fd
,
os
.
getpid
(),
format_cmdline
(
args
)
)
return
pid
,
master_fd
...
...
mitogen/ssh.py
View file @
76e476dc
...
...
@@ -62,7 +62,7 @@ class Stream(mitogen.master.Stream):
]
bits
.
append
(
self
.
hostname
)
base
=
super
(
Stream
,
self
).
get_boot_command
()
return
bits
+
map
(
commands
.
mkarg
,
base
)
return
bits
+
[
commands
.
mkarg
(
s
).
strip
()
for
s
in
base
]
def
connect
(
self
):
super
(
Stream
,
self
).
connect
()
...
...
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