Exemplo n.º 1
0
	def _app_volumes(self):
		volumes = self.app.docker_volumes[:]
		for app_volume in [self.app.get_data_dir(), self.app.get_conf_dir()]:
			app_volume = '%s:%s' % (app_volume, app_volume)
			volumes.append(app_volume)
		if self.app.host_certificate_access:
			cert_dir = '/etc/univention/ssl/%s.%s' % (ucr_get('hostname'), ucr_get('domainname'))
			cert_volume = '%s:%s:ro' % (cert_dir, cert_dir)
			volumes.append(cert_volume)
		return unique(volumes)
Exemplo n.º 2
0
	def __init__(self, *args, **kwargs):
		keys = re.findall(r'%\(([^)]+)\)', self.default_error_msg)
		keys = unique(keys)
		i = 0
		_args = []
		for key in keys:
			if key in kwargs:
				value = kwargs[key]
			else:
				try:
					value = args[i]
				except IndexError:
					raise TypeError('Need %s for %s' % (key, self.__class__.__name__))
				i += 1
			setattr(self, key, value)
			_args.append(value)
		if len(args) > i:
			self.message = args[i]
		elif 'message' in kwargs:
			self.message = kwargs.get('message')
		else:
			self.message = ''
		self.args = tuple(_args)