Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
121e490e
Commit
121e490e
authored
Aug 08, 2012
by
Jelte Jansen
Browse files
[2172] fix page_size regex
parent
a47c2eae
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/python/isc/sysinfo/sysinfo.py
View file @
121e490e
...
...
@@ -446,7 +446,7 @@ class SysInfoOSX(SysInfoFreeBSDOSX):
# store all values in a dict
values
=
{}
page_size
=
None
page_size_re
=
re
.
compile
(
'page size of [0-9]+ bytes'
)
page_size_re
=
re
.
compile
(
'
.*
page size of
(
[0-9]+
)
bytes'
)
for
line
in
lines
:
page_size_m
=
page_size_re
.
match
(
line
)
if
page_size_m
:
...
...
@@ -456,7 +456,7 @@ class SysInfoOSX(SysInfoFreeBSDOSX):
values
[
key
]
=
value
.
strip
()[:
-
1
]
# Only calculate memory if page size is known
if
page_size
is
not
None
:
self
.
_mem_free
=
int
(
values
[
'Pages free'
])
*
page_size
+
self
.
_mem_free
=
int
(
values
[
'Pages free'
])
*
page_size
+
\
int
(
values
[
'Pages speculative'
])
*
page_size
except
(
subprocess
.
CalledProcessError
,
OSError
):
pass
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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