Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
b5eefe94
Commit
b5eefe94
authored
Nov 07, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better error reporting for FUSE
parent
e320e69b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
fs/expose/fuse/__init__.py
+14
-5
No files found.
fs/expose/fuse/__init__.py
View file @
b5eefe94
...
...
@@ -395,10 +395,16 @@ def unmount(path):
FUSE filesystem. It works, but it would probably be better to use the
'unmount' method on the MountProcess class if you have it.
"""
for
num_tries
in
xrange
(
3
):
p
=
subprocess
.
Popen
([
"fusermount"
,
"-u"
,
path
],
stderr
=
subprocess
.
PIPE
)
(
stdout
,
stderr
)
=
p
.
communicate
()
if
p
.
returncode
!=
0
and
"not mounted"
not
in
stderr
:
raise
OSError
(
"filesystem could not be unmounted: "
+
path
)
if
p
.
returncode
==
0
:
return
if
"not mounted"
in
stderr
:
return
if
"not found"
in
stderr
:
return
raise
OSError
(
"filesystem could not be unmounted:
%
s (
%
s) "
%
(
path
,
stderr
,))
class
MountProcess
(
subprocess
.
Popen
):
...
...
@@ -456,7 +462,7 @@ class MountProcess(subprocess.Popen):
super
(
MountProcess
,
self
)
.
__init__
(
cmd
,
**
kwds
)
os
.
close
(
w
)
if
os
.
read
(
r
,
1
)
!=
"S"
:
raise
RuntimeError
(
"
A FUSE error occurred"
)
raise
RuntimeError
(
"
FUSE error: "
+
os
.
read
(
r
,
20
)
)
def
unmount
(
self
):
"""Cleanly unmount the FUSE filesystem, terminating this subprocess."""
...
...
@@ -510,10 +516,13 @@ class MountProcess(subprocess.Popen):
opts
[
"unmount_callback"
]
=
unmount_callback
try
:
mount
(
fs
,
path
,
**
opts
)
except
Exception
:
pass
except
Exception
,
e
:
os
.
write
(
w
,
"E"
+
str
(
e
))
os
.
close
(
w
)
else
:
if
not
successful
:
os
.
write
(
w
,
"E"
)
os
.
close
(
w
)
if
__name__
==
"__main__"
:
...
...
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