# Standard modules
import shutil
+from pathlib import Path
+
# Own modules
import fb_tools.common
-__version__ = '0.2.0'
+__version__ = '0.2.1'
MAX_PORT_NUMBER = (2 ** 16) - 1
DEFAULT_CONFIG_DIR = 'pixelpark'
DEFAULT_TERMINAL_HEIGHT = 40
DEFAULT_FORGE_URL = 'https://forge.puppetlabs.com'
+DEFAULT_FORGE_API_URL = 'https://forgeapi.puppet.com/v3/modules'
+DEFAULT_HTTP_TIMEOUT = 30
+MAX_HTTP_TIMEOUT = 600
+DEFAULT_MAIL_RECIPIENTS = ['solution@pixelpark.com']
+DEFAULT_REPLY_TO = 'solution@pixelpark.com'
+DEFAULT_MAIL_SERVER = 'prd-mail.pixelpark.com'
+
+DEFAULT_LOG_DIR = Path('/var/log/dpx-puppet-tools')
+DEFAULT_VAR_DIR = Path('/var/lib/dpx-puppet-tools')
+DEFAULT_DEPLOY_ROOT_DIR = Path('/etc/puppetlabs/code')
# =============================================================================
# Own modules
from . import __version__ as GLOBAL_VERSION
-from . import pp
+from . import pp, DEFAULT_MAIL_RECIPIENTS, DEFAULT_REPLY_TO, DEFAULT_MAIL_SERVER
+from . import DEFAULT_LOG_DIR, DEFAULT_VAR_DIR, DEFAULT_DEPLOY_ROOT_DIR
from .errors import PuppetToolsError
from .xlate import XLATOR
CONFIG_DIR = 'pixelpark'
-__version__ = '0.3.0'
+__version__ = '0.3.1'
LOG = logging.getLogger(__name__)
VALID_MAIL_METHODS = ('smtp', 'sendmail')
DEFAULT_DOMAIN = 'pixelpark.com'
"""Class for reading and providing configuration for all
application classes in this package."""
- default_mail_recipients = [
- 'solution@pixelpark.com'
- ]
+ default_mail_recipients = DEFAULT_MAIL_RECIPIENTS
default_mail_cc = []
+ default_reply_to = DEFAULT_REPLY_TO
- default_reply_to = 'solution@pixelpark.com'
-
- default_mail_server = 'prd-mail.pixelpark.com'
+ default_mail_server = DEFAULT_MAIL_SERVER
default_smtp_port = 25
current_user_name = pwd.getpwuid(os.getuid()).pw_name
re_whitespace = re.compile(r'(?:[,;]+|\s*[,;]*\s+)+')
- default_log_dir = Path('/var/log/dpx-puppet-tools')
- default_var_dir = Path('/var/lib/dpx-puppet-tools')
- default_deploy_root_dir = Path('/etc/puppetlabs/code')
+ default_log_dir = DEFAULT_LOG_DIR
+ default_var_dir = DEFAULT_VAR_DIR
+ default_deploy_root_dir = DEFAULT_DEPLOY_ROOT_DIR
# -------------------------------------------------------------------------
def __init__(