description = _("Base gitlab webhook application.")
self._data_dir = self.default_data_dir
+ self._puppet_root_env_dir = self.puppet_envs_dir
self._read_stdin = True
self.tz_name = self.default_tz_name
self._html_title = None
def data_dir(self, value):
self._data_dir = pathlib.Path(value)
+ # -----------------------------------------------------------
+ @property
+ def puppet_root_env_dir(self):
+ """The directory containing the Puppet environment directories."""
+ return self._puppet_root_env_dir
+
+ @puppet_root_env_dir.setter
+ def puppet_root_env_dir(self, value):
+ self._puppet_root_env_dir = pathlib.Path(value)
+
# -----------------------------------------------------------
@property
def log_directory(self):
res['cgi_bin_dir'] = self.cgi_bin_dir
res['log_directory'] = self.log_directory
res['data_dir'] = self.data_dir
+ res['puppet_root_env_dir'] = self.puppet_root_env_dir
res['error_logfile'] = self.error_logfile
res['logfile'] = self.logfile
res['puppetlabs_cfg_dir'] = self.puppetlabs_cfg_dir
path = self.base_dir / path
self.data_dir = path
+ if 'puppet_env_dir' in config and config['puppet_env_dir']:
+ path = pathlib.Path(config['puppet_env_dir'])
+ if path.is_absolute():
+ self._puppet_root_env_dir = path.resolve()
+ else:
+ msg = _(
+ "Path for the Puppet environments {p!r} must be "
+ "an absolute path in {f!r}.").format(
+ p=str(path), f=yaml_file)
+ self.error_data.append(msg)
+
if 'cachefile' in config:
self._cachefile = pathlib.Path(config['cachefile'])
elif 'cache_file' in config:
self.environments = []
self.env_modules = {}
self.forge_modules = None
- self.puppet_root_env_dir = self.puppet_envs_dir
self.forge_uri = self.default_forge_uri
self.http_timeout = self.default_http_timeout
self.modules = None
super(GetForgeModulesApp, self).evaluate_config(config, yaml_file)
- if 'puppet_env_dir' in config and config['puppet_env_dir']:
- path = pathlib.Path(config['puppet_env_dir'])
- if path.is_absolute():
- self.puppet_root_env_dir = path.resolve()
- else:
- msg = _(
- "Path for the Puppet environments {p!r} must be "
- "an absolute path in {f!r}.").format(
- p=str(path), f=yaml_file)
- self.error_data.append(msg)
-
if 'forge_uri' in config and config['forge_uri'] and str(config['forge_uri']).strip():
self.forge_uri = str(config['forge_uri']).strip()