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
3fb3eae7
Commit
3fb3eae7
authored
Aug 07, 2012
by
Stephen Fromm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect all selinux calls with try/except
parent
454de792
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
library/setup
+18
-0
No files found.
library/setup
View file @
3fb3eae7
...
...
@@ -124,16 +124,34 @@ class Facts(object):
self
.
facts
[
'selinux'
][
'status'
]
=
'disabled'
else
:
self
.
facts
[
'selinux'
][
'status'
]
=
'enabled'
try
:
self
.
facts
[
'selinux'
][
'policyvers'
]
=
selinux
.
security_policyvers
()
except
:
self
.
facts
[
'selinux'
][
'policyvers'
]
=
'unknown'
try
:
(
rc
,
configmode
)
=
selinux
.
selinux_getenforcemode
()
if
rc
==
0
and
Facts
.
SELINUX_MODE_DICT
.
has_key
(
configmode
):
self
.
facts
[
'selinux'
][
'config_mode'
]
=
Facts
.
SELINUX_MODE_DICT
[
configmode
]
else
:
self
.
facts
[
'selinux'
][
'config_mode'
]
=
'unknown'
except
OSError
,
e
:
self
.
facts
[
'selinux'
][
'config_mode'
]
=
'unknown'
try
:
mode
=
selinux
.
security_getenforce
()
if
Facts
.
SELINUX_MODE_DICT
.
has_key
(
mode
):
self
.
facts
[
'selinux'
][
'mode'
]
=
Facts
.
SELINUX_MODE_DICT
[
mode
]
else
:
self
.
facts
[
'selinux'
][
'mode'
]
=
'unknown'
except
OSError
,
e
:
self
.
facts
[
'selinux'
][
'mode'
]
=
'unknown'
try
:
(
rc
,
policytype
)
=
selinux
.
selinux_getpolicytype
()
if
rc
==
0
:
self
.
facts
[
'selinux'
][
'type'
]
=
policytype
else
:
self
.
facts
[
'selinux'
][
'type'
]
=
'unknown'
except
OSError
,
e
:
self
.
facts
[
'selinux'
][
'type'
]
=
'unknown'
class
Hardware
(
Facts
):
"""
...
...
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