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
6ed48b5a
Commit
6ed48b5a
authored
Feb 25, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6172 from cchurch/devel
Fix setup module to gather facts from PowerPC Macs.
parents
ca786575
1d6bdd45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
library/system/setup
+18
-2
No files found.
library/system/setup
View file @
6ed48b5a
...
...
@@ -1359,14 +1359,30 @@ class Darwin(Hardware):
sysctl
[
key
]
=
value
.
strip
()
return
sysctl
def
get_system_profile
(
self
):
rc
,
out
,
err
=
module
.
run_command
([
"/usr/sbin/system_profiler"
,
"SPHardwareDataType"
])
if
rc
!=
0
:
return
dict
()
system_profile
=
dict
()
for
line
in
out
.
splitlines
():
if
': '
in
line
:
(
key
,
value
)
=
line
.
split
(
': '
,
1
)
system_profile
[
key
.
strip
()]
=
' '
.
join
(
value
.
strip
()
.
split
())
return
system_profile
def
get_mac_facts
(
self
):
self
.
facts
[
'model'
]
=
self
.
sysctl
[
'hw.model'
]
self
.
facts
[
'osversion'
]
=
self
.
sysctl
[
'kern.osversion'
]
self
.
facts
[
'osrevision'
]
=
self
.
sysctl
[
'kern.osrevision'
]
def
get_cpu_facts
(
self
):
self
.
facts
[
'processor'
]
=
self
.
sysctl
[
'machdep.cpu.brand_string'
]
self
.
facts
[
'processor_cores'
]
=
self
.
sysctl
[
'machdep.cpu.core_count'
]
if
'machdep.cpu.brand_string'
in
self
.
sysctl
:
# Intel
self
.
facts
[
'processor'
]
=
self
.
sysctl
[
'machdep.cpu.brand_string'
]
self
.
facts
[
'processor_cores'
]
=
self
.
sysctl
[
'machdep.cpu.core_count'
]
else
:
# PowerPC
system_profile
=
self
.
get_system_profile
()
self
.
facts
[
'processor'
]
=
'
%
s @
%
s'
%
(
system_profile
[
'Processor Name'
],
system_profile
[
'Processor Speed'
])
self
.
facts
[
'processor_cores'
]
=
self
.
sysctl
[
'hw.physicalcpu'
]
def
get_memory_facts
(
self
):
self
.
facts
[
'memtotal_mb'
]
=
long
(
self
.
sysctl
[
'hw.memsize'
])
/
1024
/
1024
...
...
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