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
7834d021
Commit
7834d021
authored
Feb 20, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2138 from bcoca/2137_fix_setup_bsdjails
fixes freebsd setup issues with jails
parents
ae599d8a
aa713d72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
library/setup
+10
-12
No files found.
library/setup
View file @
7834d021
...
...
@@ -559,13 +559,10 @@ class FreeBSDHardware(Hardware):
rc
,
out
,
err
=
module
.
run_command
(
"/sbin/sysctl -n hw.ncpu"
)
self
.
facts
[
'processor_count'
]
=
out
.
strip
()
try
:
dmesg_boot
=
open
(
FreeBSDHardware
.
DMESG_BOOT
)
except
IOError
:
rc
,
out
,
err
=
module
.
run_command
(
"/sbin/dmesg"
)
dmesg_boot
=
out
for
line
in
dmesg_boot
.
readlines
():
dmesg_boot
=
get_file_content
(
FreeBSDHardware
.
DMESG_BOOT
)
if
not
dmesg_boot
:
rc
,
dmesg_boot
,
err
=
module
.
run_command
(
"/sbin/dmesg"
)
for
line
in
dmesg_boot
.
split
(
'
\n
'
):
if
'CPU:'
in
line
:
cpu
=
re
.
sub
(
r'CPU:\s+'
,
r""
,
line
)
self
.
facts
[
'processor'
]
.
append
(
cpu
.
strip
())
...
...
@@ -600,11 +597,12 @@ class FreeBSDHardware(Hardware):
def
get_mount_facts
(
self
):
self
.
facts
[
'mounts'
]
=
[]
fstab
=
get_file_content
(
'/etc/fstab'
)
for
line
in
fstab
.
split
(
'
\n
'
):
if
line
.
startswith
(
'#'
)
or
line
.
strip
()
==
''
:
continue
fields
=
re
.
sub
(
r'\s+'
,
' '
,
line
.
rstrip
(
'
\n
'
))
.
split
()
self
.
facts
[
'mounts'
]
.
append
({
'mount'
:
fields
[
1
]
,
'device'
:
fields
[
0
],
'fstype'
:
fields
[
2
],
'options'
:
fields
[
3
]})
if
fstab
:
for
line
in
fstab
.
split
(
'
\n
'
):
if
line
.
startswith
(
'#'
)
or
line
.
strip
()
==
''
:
continue
fields
=
re
.
sub
(
r'\s+'
,
' '
,
line
.
rstrip
(
'
\n
'
))
.
split
()
self
.
facts
[
'mounts'
]
.
append
({
'mount'
:
fields
[
1
]
,
'device'
:
fields
[
0
],
'fstype'
:
fields
[
2
],
'options'
:
fields
[
3
]})
def
get_device_facts
(
self
):
sysdir
=
'/dev'
...
...
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