from __future__ import absolute_import
# Standard modules
-import sys
import os
import logging
import logging.config
import re
-import traceback
-import textwrap
import pwd
-import copy
import glob
# Third party modules
import six
# Own modules
-from .global_version import __version__ as __global_version__
-
-from .errors import FunctionNotImplementedError, PpAppError
-
-from .common import pp, terminal_can_colors, to_bytes, to_bool
+from .common import pp
from .cfg_app import PpCfgAppError, PpConfigApplication
-__version__ = '0.1.2'
+__version__ = '0.1.3'
LOG = logging.getLogger(__name__)
# -------------------------------------------------------------------------
def __init__(
- self, appname=None, description=None,
- cfg_stems='homes-admin', version=__version__):
+ self, appname=None, description=None,
+ cfg_stems='homes-admin', version=__version__):
self.default_mail_recipients = [
'admin.berlin@pixelpark.com'
homes_group.add_argument(
'-R', '--chroot-dir',
metavar='DIR', dest='chroot_homedir',
- help=("Directory, where the {h!r} share is mounted from the "
+ help=(
+ "Directory, where the {h!r} share is mounted from the "
"NFS server. Maybe '/', default: {d!r}.").format(
h=self.default_home_root, d=self.default_chroot_homedir)
)
homes_group.add_argument(
'-H', '--homes',
metavar='DIR', dest='home_root',
- help=("The shared directory on the NFS server for all home directories. "
+ help=(
+ "The shared directory on the NFS server for all home directories. "
"Default: {!r}.").format(self.default_home_root)
)
homes_group.add_argument(
'-E', '--exclude-file',
metavar='FILE', dest='exclude_file',
- help=("The file containing all directories underneath {h!r}, which are "
+ help=(
+ "The file containing all directories underneath {h!r}, which are "
"excluded from all operations. Default: {f!r}.").format(
h=self.default_home_root, f=self.default_exclude_file)
)
section = self.cfg[section_name]
if section_name.lower() not in (
- 'test-home', 'test_home', 'testhome', 'homes', 'admin') :
+ 'test-home', 'test_home', 'testhome', 'homes', 'admin'):
continue
if self.verbose > 2:
raise PpHomesAdminError(msg)
self.exclude_file = v
+ self._perform_home_cmdline_opts()
+
+ self.home_root_rel = os.path.relpath(self.home_root_abs, os.sep)
+ self.home_root_real = os.path.join(self.chroot_homedir, self.home_root_rel)
+
+ # -------------------------------------------------------------------------
+ def _perform_home_cmdline_opts(self):
+
if hasattr(self.args, 'chroot_homedir') and self.args.chroot_homedir:
v = self.args.chroot_homedir
if not os.path.isabs(v):
raise PpHomesAdminError(msg)
self.exclude_file = v
- self.home_root_rel = os.path.relpath(self.home_root_abs, os.sep)
- self.home_root_real = os.path.join(self.chroot_homedir, self.home_root_rel)
-
# -------------------------------------------------------------------------
def read_exclude_dirs(self):