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
24ea5949
Commit
24ea5949
authored
Nov 12, 2013
by
Sergey Sudakovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix when the system does not have lsb_release script, but has /etc/lsb_release file
parent
f31cb7c6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
library/system/setup
+20
-2
No files found.
library/system/setup
View file @
24ea5949
...
@@ -376,8 +376,7 @@ class Facts(object):
...
@@ -376,8 +376,7 @@ class Facts(object):
def
get_lsb_facts
(
self
):
def
get_lsb_facts
(
self
):
lsb_path
=
module
.
get_bin_path
(
'lsb_release'
)
lsb_path
=
module
.
get_bin_path
(
'lsb_release'
)
if
lsb_path
is
None
:
if
lsb_path
:
return
self
.
facts
rc
,
out
,
err
=
module
.
run_command
([
lsb_path
,
"-a"
])
rc
,
out
,
err
=
module
.
run_command
([
lsb_path
,
"-a"
])
if
rc
==
0
:
if
rc
==
0
:
self
.
facts
[
'lsb'
]
=
{}
self
.
facts
[
'lsb'
]
=
{}
...
@@ -397,6 +396,25 @@ class Facts(object):
...
@@ -397,6 +396,25 @@ class Facts(object):
self
.
facts
[
'lsb'
][
'codename'
]
=
value
self
.
facts
[
'lsb'
][
'codename'
]
=
value
if
'lsb'
in
self
.
facts
and
'release'
in
self
.
facts
[
'lsb'
]:
if
'lsb'
in
self
.
facts
and
'release'
in
self
.
facts
[
'lsb'
]:
self
.
facts
[
'lsb'
][
'major_release'
]
=
self
.
facts
[
'lsb'
][
'release'
]
.
split
(
'.'
)[
0
]
self
.
facts
[
'lsb'
][
'major_release'
]
=
self
.
facts
[
'lsb'
][
'release'
]
.
split
(
'.'
)[
0
]
elif
lsb_path
is
None
and
os
.
path
.
exists
(
'/etc/lsb-release'
):
self
.
facts
[
'lsb'
]
=
{}
with
open
(
'/etc/lsb-release'
,
'r'
)
as
f
:
for
line
in
f
.
readlines
():
value
=
line
.
split
(
'='
,
1
)[
1
]
.
strip
()
if
'DISTRIB_ID'
in
line
:
self
.
facts
[
'lsb'
][
'id'
]
=
value
elif
'DISTRIB_RELEASE'
in
line
:
self
.
facts
[
'lsb'
][
'release'
]
=
value
elif
'DISTRIB_DESCRIPTION'
in
line
:
self
.
facts
[
'lsb'
][
'description'
]
=
value
elif
'DISTRIB_CODENAME'
in
line
:
self
.
facts
[
'lsb'
][
'codename'
]
=
value
else
:
return
self
.
facts
if
'lsb'
in
self
.
facts
and
'release'
in
self
.
facts
[
'lsb'
]:
self
.
facts
[
'lsb'
][
'major_release'
]
=
self
.
facts
[
'lsb'
][
'release'
]
.
split
(
'.'
)[
0
]
def
get_selinux_facts
(
self
):
def
get_selinux_facts
(
self
):
if
not
HAVE_SELINUX
:
if
not
HAVE_SELINUX
:
...
...
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