Permalink
Browse files

CA-38370: Perfmon barfs when dom0 root disk is a long path

This is because the output of df wraps onto two lines.

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
  • Loading branch information...
1 parent 313631d commit d9735d335bf788e06d0f239d865e2a6c59e73236 @alexz alexz committed Mar 8, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 scripts/perfmon
View
@@ -354,8 +354,8 @@ def get_percent_fs_usage(ignored):
"Get the percent usage of the host filesystem. Input list is ignored and should be empty"
# this file is on the filesystem of interest in both OEM and Retail
output = commands.getoutput('df /etc/passwd')
- line = output.split('\n')[1]
- percentage = line.split()[4]
+ output = ' '.join(output.splitlines()[1:]) # remove header line and rewrap on single line
+ percentage = output.split()[4]
# strip of % character and convert to float
return float(percentage[0:-1])/100.0

0 comments on commit d9735d3

Please sign in to comment.