import six
import yaml
import pytz
+import pathlib
# Own modules
from fb_tools.common import pp, to_bytes, to_bool
-from fb_tools.obj import FbBaseObjectError, FbBaseObject
+from fb_tools.obj import FbBaseObject
from fb_tools.handler import BaseHandler
+from fb_tools.errors import FbAppError
+from fb_tools.app import BaseApplication
from . import __version__ as __pkg_version__
# =============================================================================
-class BaseHookError(FbBaseObjectError):
+class BaseHookError(FbAppError):
"""
Base error class useable by all descendand objects.
"""
"""
# =============================================================================
-class BaseHookApp(FbBaseObject):
+class BaseHookApp(BaseApplication):
"""
Base class for the application objects.
"""
- cgi_bin_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
+ cgi_bin_dir = pathlib.Path(__file__).parent.parent.resolve()
puppetlabs_cfg_dir = os.sep + os.path.join('etc', 'puppetlabs')
puppet_envs_dir = os.path.join(puppetlabs_cfg_dir, 'code', 'environments')