Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
hash_backup
Commits
47dbb015
Commit
47dbb015
authored
Feb 17, 2016
by
Anders Blomdell
Browse files
Fixed asyncio reader. Added -n to ssh command.
parent
7adc50e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
loghandler.py
View file @
47dbb015
...
...
@@ -75,10 +75,22 @@ class LOG:
self
.
decode
=
decode
def
__call__
(
self
,
flush
=
False
):
def
__call__
(
self
):
with
self
.
mutex
:
buf
=
os
.
read
(
self
.
fd
,
4096
)
self
.
buf
.
extend
(
buf
)
while
True
:
buf
=
os
.
read
(
self
.
fd
,
10
)
i
=
self
.
buf
.
find
(
b
'
\n
'
)
if
i
<
0
:
break
self
.
log
.
MESSAGE
(
self
.
decode
(
self
.
buf
[
0
:
i
]),
level
=
level
)
self
.
buf
=
self
.
buf
[
i
+
1
:]
def
flush
(
self
):
with
self
.
mutex
:
while
True
:
buf
=
os
.
read
(
self
.
fd
,
4096
)
if
len
(
buf
)
==
0
:
break
self
.
buf
.
extend
(
buf
)
while
True
:
...
...
@@ -87,8 +99,8 @@ class LOG:
self
.
log
.
MESSAGE
(
self
.
decode
(
self
.
buf
[
0
:
i
]),
level
=
level
)
self
.
buf
=
self
.
buf
[
i
+
1
:]
if
len
(
self
.
buf
)
>
0
and
flush
:
self
.
log
.
MESSAGE
(
self
.
decode
(
self
.
buf
),
level
=
level
)
if
len
(
self
.
buf
)
>
0
:
self
.
log
.
MESSAGE
(
self
.
decode
(
self
.
buf
),
level
=
level
)
class
MakeFile
:
def
__init__
(
self
,
log
):
...
...
@@ -102,5 +114,6 @@ class LOG:
def
__del__
(
self
):
loop
.
remove_reader
(
self
.
rpipe
)
os
.
close
(
self
.
wpipe
)
self
.
reader
(
flush
=
True
)
self
.
reader
.
flush
()
return
MakeFile
(
self
)
primary.py
View file @
47dbb015
...
...
@@ -156,7 +156,7 @@ class Client:
log
=
self
.
server_log
)
socket_path
=
'/tmp/%s_client'
%
(
self
.
uuid
)
cmd
=
(
[
'ssh'
,
self
.
entry
.
mount
.
host
]
+
[
'ssh'
,
'-n'
,
self
.
entry
.
mount
.
host
]
+
(
self
.
options
.
user
and
[
'-l'
,
self
.
options
.
user
]
or
[])
+
(
self
.
options
.
identity
and
...
...
Write
Preview
Supports
Markdown
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