import shutil
import time
import locale
+import sys
from subprocess import Popen, PIPE
from .homes_admin import PpHomesAdminError, PpHomesAdminApp
-__version__ = '0.6.2'
+__version__ = '0.6.3'
LOG = logging.getLogger(__name__)
ZERO = datetime.timedelta(0)
return result
# -------------------------------------------------------------------------
- def check_home_utilization(self):
-
- LOG.info("Checking utilization of home directories ...")
+ def _silly_open_homedirs(self):
# Senseless opening of all user home directories to activate automounter
for user_name in self.passwd_data:
continue
if not pwd_home_dir.startswith(self.home_root_abs):
if self.verbose > 2:
- LOG.debug("Home dir {!r} is not below {!r}.".format(pwd_home_dir, self.home_root_abs))
+ LOG.debug("Home dir {!r} is not below {!r}.".format(
+ pwd_home_dir, self.home_root_abs))
continue
abs_home_dir = os.path.join(self.chroot_homedir, os.path.relpath(pwd_home_dir, os.sep))
LOG.debug("Trying to open {!r} ...".format(abs_home_dir))
os.listdir(abs_home_dir)
if self.verbose > 2:
LOG.debug("Found home directory {!r} ...".format(abs_home_dir))
- except OSError as e:
+ except OSError:
LOG.warn("Directory {!r} does not exists.".format(abs_home_dir))
+ # -------------------------------------------------------------------------
+ def check_home_utilization(self):
+
+ LOG.info("Checking utilization of home directories ...")
+
+ self._silly_open_homedirs()
+
glob_pattern = os.path.join(self.home_root_real, '*')
all_home_entries = glob.glob(glob_pattern)