from .config import CrTplConfiguration
+from .errors import CrTplAppError
+
from .handler import CrTplHandler
from .xlate import __module_dir__ as __xlate_module_dir__
from .xlate import __mo_file__ as __xlate_mo_file__
from .xlate import XLATOR, LOCALE_DIR, DOMAIN
-__version__ = '1.5.2'
+__version__ = '1.5.3'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-# =============================================================================
-class CrTplAppError(FbAppError):
- """ Base exception class for all exceptions in this application."""
- pass
-
-
# =============================================================================
class NrTemplatesOptionAction(argparse.Action):
# Own modules
from fb_tools.common import pp, to_str, is_sequence, to_bool
-from fb_tools.errors import HandlerError, ExpectedHandlerError
from fb_tools.handling_obj import CompletedProcess
from fb_tools.handler import BaseHandler
from fb_tools.xlate import format_list
from .config import CrTplConfiguration
+from .errors import CobblerError, ExpectedCobblerError
+
from .xlate import XLATOR
-__version__ = '0.10.0'
+__version__ = '0.10.1'
LOG = logging.getLogger(__name__)
ngettext = XLATOR.ngettext
-# =============================================================================
-class CobblerError(HandlerError):
- """Exception class for unexpected exceptions."""
- pass
-
-# =============================================================================
-class ExpectedCobblerError(ExpectedHandlerError, CobblerError):
- """Exception class for predictible exceptions."""
- pass
-
# =============================================================================
class Cobbler(BaseHandler):
"""
if not isinstance(cfg, CrTplConfiguration):
msg = _("{w} is not an instance of {c}, but an instance of {i} instead.").format(
w='Parameter cfg', c='CrTplConfiguration', i=cfg.__class__.__name__)
- raise HandlerError(msg)
+ raise CobblerError(msg)
self.host = CrTplConfiguration.default_cobbler_host
self.cobbler_bin = CrTplConfiguration.default_cobbler_bin
from fb_tools.common import is_sequence, pp, to_bool
from fb_tools.obj import FbGenericBaseObject, FbBaseObject
from fb_tools.collections import CIStringSet
-from fb_tools.multi_config import MultiConfigError, BaseMultiConfig
+from fb_tools.multi_config import BaseMultiConfig
from fb_tools.multi_config import DEFAULT_ENCODING
from fb_tools.xlate import format_list
from . import DEFAULT_CONFIG_DIR, DEFAULT_DISTRO_ARCH, MAX_PORT_NUMBER
+from .errors import CrTplConfigError
+
from .xlate import XLATOR
-__version__ = '2.3.0'
+__version__ = '2.3.1'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
)
-# =============================================================================
-class CrTplConfigError(MultiConfigError):
- """Base error class for all exceptions happened during
- execution this configured application"""
-
- pass
-
-
# =============================================================================
class LdapConnectionInfo(FbBaseObject):
"""Encapsulating all necessary data to connect to a LDAP server."""
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+@summary: The module for special error classes in this package
+
+@author: Frank Brehm
+@contact: frank@brehm-online.com
+@copyright: © 2023 by Frank Brehm, Berlin
+"""
+from __future__ import absolute_import
+
+# Standard modules
+
+# Third party modules
+
+from fb_tools.errors import FbAppError
+from fb_tools.errors import FbHandlerError
+from fb_tools.errors import HandlerError, ExpectedHandlerError
+from fb_tools.multi_config import MultiConfigError
+
+# Own modules
+from .xlate import XLATOR
+
+__version__ = '0.1.0'
+
+_ = XLATOR.gettext
+
+
+MSG_NO_CLUSTER = _(
+ "Could not find a datastore of {size:0.1f} GiB size in "
+ "datastore cluster {c_name!r}.")
+
+
+# =============================================================================
+class CrTplAppError(FbAppError):
+ """ Base exception class for all exceptions in this application."""
+ pass
+
+
+# =============================================================================
+class CrTplConfigError(MultiConfigError):
+ """Base error class for all exceptions happened during
+ execution this configured application"""
+
+ pass
+
+
+# =============================================================================
+class CobblerError(HandlerError):
+ """Exception class for unexpected exceptions."""
+ pass
+
+
+# =============================================================================
+class ExpectedCobblerError(ExpectedHandlerError, CobblerError):
+ """Exception class for predictible exceptions."""
+ pass
+
+
+# =============================================================================
+class TempVmExistsError(ExpectedHandlerError):
+ """Special error class for the case, if the temporary VM is already existing."""
+
+ # -------------------------------------------------------------------------
+ def __init__(self, vm_name):
+
+ self.vm_name = vm_name
+
+ # -------------------------------------------------------------------------
+ def __str__(self):
+
+ msg = _("The temporary VM {!r} is already existing, cannot continue.").format(self.vm_name)
+ return msg
+
+
+# =============================================================================
+class NoDatastoreFoundError(ExpectedHandlerError):
+ """Special error class for the case, no appropriate datastore coud be found."""
+
+ # -------------------------------------------------------------------------
+ def __init__(self, data_size_gb, ds_cluster_name=None):
+
+ self.data_size_gb = data_size_gb
+ self.ds_cluster_name = ds_cluster_name
+
+ # -------------------------------------------------------------------------
+ def __str__(self):
+
+ if self.ds_cluster_name:
+ msg = MSG_NO_CLUSTER.format(size=self.data_size_gb, c_name=self.ds_cluster_name)
+ else:
+ msg = _("Could not find a datastore of {:0.1f} GiB size.").format(
+ self.data_size_gb)
+
+ return msg
+
+
+# =============================================================================
+
+if __name__ == "__main__":
+
+ pass
+
+# =============================================================================
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 list
from .cobbler import Cobbler
+from .errors import MSG_NO_CLUSTER, TempVmExistsError, NoDatastoreFoundError
+
from .xlate import XLATOR
-__version__ = '2.3.3'
+__version__ = '2.3.4'
LOG = logging.getLogger(__name__)
TZ = pytz.timezone('Europe/Berlin')
_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-MSG_NO_CLUSTER = _(
- "Could not find a datastore of {size:0.1f} GiB size in "
- "datastore cluster {c_name!r}.")
-
-
-# =============================================================================
-class TempVmExistsError(ExpectedHandlerError):
- """Special error class for the case, if the temporary VM is already existing."""
-
- # -------------------------------------------------------------------------
- def __init__(self, vm_name):
-
- self.vm_name = vm_name
-
- # -------------------------------------------------------------------------
- def __str__(self):
-
- msg = _("The temporary VM {!r} is already existing, cannot continue.").format(self.vm_name)
- return msg
-
-
-# =============================================================================
-class NoDatastoreFoundError(ExpectedHandlerError):
- """Special error class for the case, no appropriate datastore coud be found."""
-
- # -------------------------------------------------------------------------
- def __init__(self, data_size_gb, ds_cluster_name=None):
-
- self.data_size_gb = data_size_gb
- self.ds_cluster_name = ds_cluster_name
-
- # -------------------------------------------------------------------------
- def __str__(self):
-
- if self.ds_cluster_name:
- msg = MSG_NO_CLUSTER.format(size=self.data_size_gb, c_name=self.ds_cluster_name)
- else:
- msg = _("Could not find a datastore of {:0.1f} GiB size.").format(
- self.data_size_gb)
-
- return msg
-
-
# =============================================================================
class CrTplHandler(BaseHandler):
"""