Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
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
ansible
Commits
8eda23f8
Commit
8eda23f8
authored
Aug 17, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak service module pattern= logic so ./hacking/test-module does not give false positives
parent
bc571ccb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
library/service
+9
-4
No files found.
library/service
View file @
8eda23f8
...
@@ -68,21 +68,26 @@ def _get_service_status(name, pattern):
...
@@ -68,21 +68,26 @@ def _get_service_status(name, pattern):
# If pattern is provided, search for that
# If pattern is provided, search for that
# before checking initctl, service output, and other tricks
# before checking initctl, service output, and other tricks
if
pattern
is
not
None
:
if
pattern
is
not
None
:
psbin
=
'/bin/ps'
psbin
=
'/bin/ps'
if
not
os
.
path
.
exists
(
psbin
):
if
not
os
.
path
.
exists
(
psbin
):
if
os
.
path
.
exists
(
'/usr/bin/ps'
):
if
os
.
path
.
exists
(
'/usr/bin/ps'
):
psbin
=
'/usr/bin/ps'
psbin
=
'/usr/bin/ps'
else
:
else
:
psbin
=
None
psbin
=
None
if
psbin
is
not
None
:
if
psbin
is
not
None
:
(
rc
,
psout
,
pserr
)
=
_run
(
'
%
s
%
s'
%
(
psbin
,
PS_OPTIONS
))
(
rc
,
psout
,
pserr
)
=
_run
(
'
%
s
%
s'
%
(
psbin
,
PS_OPTIONS
))
# If rc is 0, set running as appropriate
# If rc is 0, set running as appropriate
# If ps command fails, fall back to other means.
# If ps command fails, fall back to other means.
if
rc
==
0
:
if
rc
==
0
:
if
pattern
in
psout
:
running
=
False
running
=
True
lines
=
psout
.
split
(
"
\n
"
)
else
:
for
line
in
lines
:
running
=
False
if
pattern
in
line
and
not
"pattern="
in
line
:
# so as to not confuse ./hacking/test-module
running
=
True
break
# Check if we got upstart on the system and then the job state
# Check if we got upstart on the system and then the job state
if
INITCTL
!=
None
and
running
is
None
:
if
INITCTL
!=
None
and
running
is
None
:
...
...
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