sysinfo should display information about disk usage

Bug #259585 reported by Christopher Armstrong
4
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
Undecided
Christopher Armstrong
Landscape Server
Fix Released
Undecided
Christopher Armstrong

Bug Description

A header should be printed with the 'primary' disk usage, and a Note should be added for any filesystem using over a certain percentage of its capacity.

Related branches

Revision history for this message
Christopher Armstrong (radix) wrote :

Ready for review in the attached branch

Changed in landscape:
assignee: nobody → radix
status: New → In Progress
Changed in landscape-client:
assignee: nobody → radix
status: New → In Progress
Revision history for this message
Jamu Kakar (jkakar) wrote :

[1]

+ - device: The device file which is mounted.
+ - mount-point
+ - filesystem: The filesystem type.

A description for 'mount-point' would be nice. Something like:

mount-point: The path to the root of the filesystem.

[2]

+ self._sysinfo.add_header("Usage of " + main_filesystem["mount-point"],

The header would be a touch more informative with actual values
included in the output:

  Usage of /home: 44.7% (34GB/76GB)

This is cool! I think adding configuration to this plugin should be
done before the feature is shipped with Intrepid, but that can be
done in a subsequent branch.

+1!

Revision history for this message
Kevin McDermott (bigkevmcd) wrote :

+def get_filesystem_for_path(path, mounts_file, statvfs_):

This doesn't seem to handle symlinked paths too well?

Sadly, os.statvfs on Python doesn't return the fs_fid field from Linux :-(

Depends how serious we think this is...

And #2 of Jamu's review is definitely pretty useful...

Revision history for this message
Thomas Herve (therve) wrote :

[1] Flakes
landscape/sysinfo/disk.py:4: 'statvfs' imported but unused
landscape/sysinfo/disk.py:8: 'MountInfo' imported but unused
landscape/lib/disk.py:3: 'os' imported but unused

[2] Some trailing whitespaces (disk.py, test_disk.py, test_mountinfo.py)

[3] There is a little problem with the note about capacity: it's on if I have a CD or DVD in my machine (reporting it as 100%). Maybe filtering iso9660 and udf is enough

[4]
+ kwargs["statvfs"] = lambda path: (0,0,0,0,0,0,0,0,0,0)
(0,) * 10 ?

That's cool, +1, [3] is the only point worrying me a bit.

Revision history for this message
Christopher Armstrong (radix) wrote :

Ok, all points fixed.

therve: indeed, I've gone with checking the filesystem type to ignore optical drives.

Revision history for this message
Christopher Armstrong (radix) wrote :

I'd really like another look at this before I merge it, since there were some significantish changes.

Revision history for this message
Thomas Herve (therve) wrote :

Still good for me!

Changed in landscape:
milestone: none → thames-pre-7
status: In Progress → Fix Committed
Changed in landscape-client:
status: In Progress → Fix Committed
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This was released into production.

Changed in landscape-client:
status: Fix Committed → Fix Released
Changed in landscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.