Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cloudooo
Commits
5e41f4c1
Commit
5e41f4c1
authored
Oct 25, 2011
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If subprocess command fails, then exit immediately and display error message
parent
b678eb79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+5
-3
No files found.
cloudooo/handler/ooo/mimemapper.py
View file @
5e41f4c1
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
import
pkg_resources
import
pkg_resources
from
re
import
findall
from
re
import
findall
from
subprocess
import
Popen
,
PIPE
from
subprocess
import
Popen
,
PIPE
from
subprocess
import
STDOUT
from
zope.interface
import
implements
from
zope.interface
import
implements
from
filter
import
Filter
from
filter
import
Filter
from
os
import
environ
,
path
from
os
import
environ
,
path
...
@@ -107,9 +108,10 @@ class MimeMapper(object):
...
@@ -107,9 +108,10 @@ class MimeMapper(object):
"--hostname=%s"
%
hostname
,
"--hostname=%s"
%
hostname
,
"--port=%s"
%
port
]
"--port=%s"
%
port
]
stdout
,
stderr
=
Popen
(
command
,
process
=
Popen
(
command
,
stdout
=
PIPE
,
stderr
=
STDOUT
,
close_fds
=
True
)
stdout
=
PIPE
,
stdout
,
stderr
=
process
.
communicate
()
close_fds
=
True
).
communicate
()
if
process
.
returncode
:
raise
ValueError
(
stdout
)
filter_dict
,
type_dict
=
json
.
loads
(
stdout
)
filter_dict
,
type_dict
=
json
.
loads
(
stdout
)
for
filter_name
,
value
in
filter_dict
.
iteritems
():
for
filter_name
,
value
in
filter_dict
.
iteritems
():
flag
=
value
.
get
(
"Flags"
)
flag
=
value
.
get
(
"Flags"
)
...
...
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