Closed JCallicoat closed 4 months ago
Yes that's how we had it pretty much done for other checks to use lxc-attach. But these checks had been deactivated due to pytho3 issues with the lxc-python module. Did you test this on a recent deployment under python3?
Is it worth having a python2 branch with this fix in place?
Is it worth having a python2 branch with this fix in place?
We already have a python2 branch in place but we need to check if this was also used for docker containers (OSP) or just lxc
The previous method of using chroot to check container storage fails when the container uses a symlink from /etc/mtab to ../proc/self/mounts since the container is running in an isolated pid/mnt namespace and /proc/self is not visible in the chroot.
This commit uses the the
attach_wait
method from thelxc
module to run the df command in the container pid/mnt namespace and parses the df output to gather usage percentage for each mounted device.Fixes #724