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
9cea2926
Commit
9cea2926
authored
Feb 23, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up OS family code
parent
cf23d64a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
42 deletions
+13
-42
library/setup
+13
-42
No files found.
library/setup
View file @
9cea2926
...
...
@@ -131,44 +131,16 @@ class Facts(object):
def
get_distribution_facts
(
self
):
# A list with OS Family members
OSFAMILY
=
{
'RedHat'
:
'RedHat'
,
'Fedora'
:
'RedHat'
,
'CentOS'
:
'RedHat'
,
'Scientific'
:
'RedHat'
,
'SLC'
:
'RedHat'
,
'Ascendos'
:
'RedHat'
,
'CloudLinux'
:
'RedHat'
,
'PSBM'
:
'RedHat'
,
'OracleLinux'
:
'RedHat'
,
'OVS'
:
'RedHat'
,
'OEL'
:
'RedHat'
,
'Amazon'
:
'RedHat'
,
'XenServer'
:
'RedHat'
,
#
'Ubuntu'
:
'Debian'
,
'Debian'
:
'Debian'
,
#
'SLES'
:
'Suse'
,
'SLED'
:
'Suse'
,
'OpenSuSE'
:
'Suse'
,
'SuSE'
:
'Suse'
,
#
'Gentoo'
:
'Gentoo'
,
#
'Archlinux'
:
'Archlinux'
,
#
'Mandriva'
:
'Mandrake'
,
'Mandrake'
:
'Mandrake'
,
#
'Solaris'
:
'Solaris'
,
'Nexenta'
:
'Solaris'
,
'OmniOS'
:
'Solaris'
,
'OpenIndiana'
:
'Solaris'
,
'SmartOS'
:
'Solaris'
,
#
'AIX'
:
'AIX'
}
OS_FAMILY
=
dict
(
RedHat
=
'RedHat'
,
Fedora
=
'RedHat'
,
CentOS
=
'RedHat'
,
Scientific
=
'RedHat'
,
SLC
=
'RedHat'
,
Ascendos
=
'RedHat'
,
CloudLinux
=
'RedHat'
,
PSBM
=
'RedHat'
,
OracleLinux
=
'RedHat'
,
OVS
=
'RedHat'
,
OEL
=
'RedHat'
,
Amazon
=
'RedHat'
,
XenServer
=
'RedHat'
,
Ubuntu
=
'Debian'
,
Debian
=
'Debian'
,
SLES
=
'Suse'
,
SLED
=
'Suse'
,
OpenSuSE
=
'Suse'
,
SuSE
=
'Suse'
,
Gentoo
=
'Gentoo'
,
Archlinux
=
'Archlinux'
,
Mandriva
=
'Mandrake'
,
Mandrake
=
'Mandrake'
,
Solaris
=
'Solaris'
,
Nexenta
=
'Solaris'
,
OmniOS
=
'Solaris'
,
OpenIndiana
=
'Solaris'
,
SmartOS
=
'Solaris'
,
AIX
=
'AIX'
)
if
self
.
facts
[
'system'
]
==
'AIX'
:
self
.
facts
[
'distribution'
]
=
'AIX'
...
...
@@ -200,10 +172,9 @@ class Facts(object):
else
:
self
.
facts
[
'distribution'
]
=
name
# Find the family
self
.
facts
[
'osfamily'
]
=
self
.
facts
[
'distribution'
]
if
self
.
facts
[
'distribution'
]
in
OSFAMILY
:
self
.
facts
[
'osfamily'
]
=
OSFAMILY
[
self
.
facts
[
'distribution'
]]
self
.
facts
[
'os_family'
]
=
self
.
facts
[
'distribution'
]
if
self
.
facts
[
'distribution'
]
in
OS_FAMILY
:
self
.
facts
[
'os_family'
]
=
OS_FAMILY
[
self
.
facts
[
'distribution'
]]
def
get_cmdline
(
self
):
data
=
get_file_content
(
'/proc/cmdline'
)
...
...
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