Don't use -o argument to "free"

The /bin/free on Fedora 21 doesn't understand -o argument to free;
that being:

---
 -o, --old
   Display the output in old format, the only difference being this
   option will disable the display of the "buffer adjusted" line.
---

i.e. the difference is the "-/+ buffers/cache" line.  Since the sed
only matches on the line starting "^Mem", this is not relevant anyway.

Change-Id: Ib2f763ea82b9a3b397d202453099d58e5dd5a355
This commit is contained in:
Ian Wienand 2014-11-06 10:39:36 +11:00
parent 677d37e101
commit f2d759d1f5

View File

@ -2,6 +2,6 @@
Facter.add("memorytotalbytes") do
setcode do
Facter::Util::Resolution.exec('free -bo | sed -n \'s/^Mem:\W\+\([0-9]\+\).*$/\1/p\'')
Facter::Util::Resolution.exec('free -b | sed -n \'s/^Mem:\W\+\([0-9]\+\).*$/\1/p\'')
end
end