from . import __version__ as GLOBAL_VERSION
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 . import DEFAULT_ENVIRONMENTS_ROOT_DIR
from .errors import PuppetToolsError
from .xlate import XLATOR
CONFIG_DIR = 'pixelpark'
-__version__ = '0.3.2'
+__version__ = '0.3.3'
LOG = logging.getLogger(__name__)
VALID_MAIL_METHODS = ('smtp', 'sendmail')
DEFAULT_DOMAIN = 'pixelpark.com'
default_log_dir = DEFAULT_LOG_DIR
default_var_dir = DEFAULT_VAR_DIR
default_deploy_root_dir = DEFAULT_DEPLOY_ROOT_DIR
+ default_env_root_dir = DEFAULT_ENVIRONMENTS_ROOT_DIR
# -------------------------------------------------------------------------
def __init__(
self.log_dir = copy.copy(self.default_log_dir)
self.var_dir = copy.copy(self.default_var_dir)
self.deploy_root_dir = copy.copy(self.default_deploy_root_dir)
+ self.env_root_dir = copy.copy(self.default_env_root_dir)
add_stems = []
if additional_stems:
res['current_user_name'] = self.current_user_name
res['default_deploy_root_dir'] = self.default_deploy_root_dir
res['default_domain'] = self.default_domain
+ res['default_env_root_dir'] = self.default_env_root_dir
res['default_log_dir'] = self.default_log_dir
res['default_mail_cc'] = self.default_mail_cc
res['default_mail_method'] = self.default_mail_method
re_deploy_root_dir = re.compile(
r'^\s*deploy[_-]*root(?:[_-]*dir)?\s*$', re.IGNORECASE)
+ re_env_root_dir = re.compile(
+ r'^\s*env(?:ironments?)?[_-]*root(?:[_-]*dir)?\s*$', re.IGNORECASE)
for key in section.keys():
value = section[key].strip()
LOG.warn(msg)
continue
+ if re_env_root_dir.match(key):
+ env_root_dir = Path(value)
+ if env_root_dir.is_absolute():
+ self.env_root_dir = env_root_dir
+ else:
+ msg = _(
+ "The path to the root environments directory {!r} "
+ "must be absolute.").format(str(env_root_dir))
+ LOG.warn(msg)
+ continue
+
# -------------------------------------------------------------------------
def _eval_mail(self, section_name, section):