Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
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
Ivan Tyagov
cloudooo
Commits
1da80792
Commit
1da80792
authored
May 05, 2014
by
Kazuhiko Shiozaki
Committed by
Yusei Tahara
Nov 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
follow API changes of psutil-2.0.0.
parent
b3a5d1b4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
cloudooo/handler/ooo/application/application.py
cloudooo/handler/ooo/application/application.py
+1
-1
cloudooo/handler/ooo/application/openoffice.py
cloudooo/handler/ooo/application/openoffice.py
+2
-2
cloudooo/handler/ooo/monitor/memory.py
cloudooo/handler/ooo/monitor/memory.py
+1
-1
cloudooo/tests/runHandlerUnitTest.py
cloudooo/tests/runHandlerUnitTest.py
+1
-1
setup.py
setup.py
+1
-1
No files found.
cloudooo/handler/ooo/application/application.py
View file @
1da80792
...
@@ -85,7 +85,7 @@ class Application(object):
...
@@ -85,7 +85,7 @@ class Application(object):
process
=
Process
(
pid
)
process
=
Process
(
pid
)
try
:
try
:
for
connection
in
process
.
get_
connections
():
for
connection
in
process
.
connections
():
if
connection
.
status
==
'LISTEN'
and
\
if
connection
.
status
==
'LISTEN'
and
\
connection
.
local_address
[
1
]
==
self
.
port
:
connection
.
local_address
[
1
]
==
self
.
port
:
return
True
return
True
...
...
cloudooo/handler/ooo/application/openoffice.py
View file @
1da80792
...
@@ -117,8 +117,8 @@ class OpenOffice(Application):
...
@@ -117,8 +117,8 @@ class OpenOffice(Application):
def
_releaseOpenOfficePort
(
self
):
def
_releaseOpenOfficePort
(
self
):
for
process
in
psutil
.
process_iter
():
for
process
in
psutil
.
process_iter
():
try
:
try
:
if
process
.
exe
==
join
(
self
.
office_binary_path
,
self
.
_bin_soffice
):
if
process
.
exe
()
==
join
(
self
.
office_binary_path
,
self
.
_bin_soffice
):
for
connection
in
process
.
get_
connections
():
for
connection
in
process
.
connections
():
if
connection
.
status
==
"LISTEN"
and
\
if
connection
.
status
==
"LISTEN"
and
\
connection
.
local_address
[
1
]
==
self
.
port
:
connection
.
local_address
[
1
]
==
self
.
port
:
process
.
terminate
()
process
.
terminate
()
...
...
cloudooo/handler/ooo/monitor/memory.py
View file @
1da80792
...
@@ -52,7 +52,7 @@ class MonitorMemory(Monitor, Process):
...
@@ -52,7 +52,7 @@ class MonitorMemory(Monitor, Process):
if
not
hasattr
(
self
,
'process'
)
or
\
if
not
hasattr
(
self
,
'process'
)
or
\
self
.
process
.
pid
!=
int
(
self
.
openoffice
.
pid
()):
self
.
process
.
pid
!=
int
(
self
.
openoffice
.
pid
()):
self
.
create_process
()
self
.
create_process
()
return
self
.
process
.
get_
memory_info
().
rss
/
(
1024
*
1024
)
return
self
.
process
.
memory_info
().
rss
/
(
1024
*
1024
)
except
TypeError
:
except
TypeError
:
logger
.
debug
(
"OpenOffice is stopped"
)
logger
.
debug
(
"OpenOffice is stopped"
)
return
0
return
0
...
...
cloudooo/tests/runHandlerUnitTest.py
View file @
1da80792
...
@@ -17,7 +17,7 @@ from signal import SIGQUIT
...
@@ -17,7 +17,7 @@ from signal import SIGQUIT
def
wait_use_port
(
pid
,
timeout_limit
=
30
):
def
wait_use_port
(
pid
,
timeout_limit
=
30
):
process
=
psutil
.
Process
(
pid
)
process
=
psutil
.
Process
(
pid
)
for
n
in
range
(
timeout_limit
):
for
n
in
range
(
timeout_limit
):
if
len
(
process
.
get_
connections
())
>
0
:
if
len
(
process
.
connections
())
>
0
:
return
True
return
True
sleep
(
1
)
sleep
(
1
)
return
False
return
False
...
...
setup.py
View file @
1da80792
...
@@ -14,7 +14,7 @@ install_requires = [
...
@@ -14,7 +14,7 @@ install_requires = [
'PasteDeploy'
,
'PasteDeploy'
,
'PasteScript'
,
'PasteScript'
,
'WSGIUtils'
,
'WSGIUtils'
,
'psutil>=
0.2
.0'
,
'psutil>=
2.0
.0'
,
'lxml'
,
'lxml'
,
'python-magic'
,
'python-magic'
,
'argparse'
,
'argparse'
,
...
...
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