Merge pull request #11287 from kstrauser/freebsd6fixes
Fixes for FreeBSD get_memory_facts
This commit is contained in:
commit
896da2a09e
1 changed files with 4 additions and 3 deletions
|
@ -1264,13 +1264,14 @@ class FreeBSDHardware(Hardware):
|
||||||
# Device 1M-blocks Used Avail Capacity
|
# Device 1M-blocks Used Avail Capacity
|
||||||
# /dev/ada0p3 314368 0 314368 0%
|
# /dev/ada0p3 314368 0 314368 0%
|
||||||
#
|
#
|
||||||
rc, out, err = module.run_command("/usr/sbin/swapinfo -m")
|
rc, out, err = module.run_command("/usr/sbin/swapinfo -k")
|
||||||
lines = out.split('\n')
|
lines = out.split('\n')
|
||||||
if len(lines[-1]) == 0:
|
if len(lines[-1]) == 0:
|
||||||
lines.pop()
|
lines.pop()
|
||||||
data = lines[-1].split()
|
data = lines[-1].split()
|
||||||
self.facts['swaptotal_mb'] = data[1]
|
if data[0] != 'Device':
|
||||||
self.facts['swapfree_mb'] = data[3]
|
self.facts['swaptotal_mb'] = int(data[1]) / 1024
|
||||||
|
self.facts['swapfree_mb'] = int(data[3]) / 1024
|
||||||
|
|
||||||
@timeout(10)
|
@timeout(10)
|
||||||
def get_mount_facts(self):
|
def get_mount_facts(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue