def getOptions(self, section = None):
		opts = []
		self.__opts = ConfigReader.getOptions(self, "Definition", opts)

		if section:
			# Get the options of a specific jail.
			jail = JailReader(section)
			jail.read()
			ret = jail.getOptions()
			if ret:
				if jail.isEnabled():
					# We only add enabled jails
					self.__jails.append(jail)
			else:
				logSys.error("Errors in jail '%s'. Skipping..." % section)
				return False
		else:
			# Get the options of all jails.
			for sec in self.sections():
				jail = JailReader(sec)
				jail.read()
				ret = jail.getOptions()
				if ret:
					if jail.isEnabled():
						# We only add enabled jails
						self.__jails.append(jail)
				else:
					logSys.error("Errors in jail '" + sec + "'. Skipping...")
					return False
		return True
Beispiel #2
0
	def getOptions(self, section=None):
		"""Reads configuration for jail(s) and adds enabled jails to __jails
		"""
		opts = []
		self.__opts = ConfigReader.getOptions(self, "Definition", opts)

		if section is None:
			sections = self.sections()
		else:
			sections = [ section ]

		# Get the options of all jails.
		parse_status = True
		for sec in sections:
			jail = JailReader(sec, basedir=self.getBaseDir(),
							  force_enable=self.__force_enable)
			jail.read()
			ret = jail.getOptions()
			if ret:
				if jail.isEnabled():
					# We only add enabled jails
					self.__jails.append(jail)
			else:
				logSys.error("Errors in jail %r. Skipping..." % sec)
				parse_status = False
		return parse_status
Beispiel #3
0
	def getOptions(self):
		opts = []
		self.__opts = ConfigReader.getOptions(self, "Definition", opts)
		for sec in self.sections():
			jail = JailReader(sec)
			jail.read()
			ret = jail.getOptions()
			if ret:
				if jail.isEnabled():
					
					self.__jails.append(jail)
			else:
				logSys.error("Errors in jail '" + sec + "'. Skipping...")
				return False
		return True
Beispiel #4
0
    def getOptions(self, section=None):
        """Reads configuration for jail(s) and adds enabled jails to __jails
		"""
        opts = []
        self.__opts = ConfigReader.getOptions(self, "Definition", opts)

        if section is None:
            sections = self.sections()
        else:
            sections = [section]

        # Get the options of all jails.
        parse_status = True
        for sec in sections:
            jail = JailReader(sec,
                              basedir=self.getBaseDir(),
                              force_enable=self.__force_enable)
            jail.read()
            ret = jail.getOptions()
            if ret:
                if jail.isEnabled():
                    # We only add enabled jails
                    self.__jails.append(jail)
            else:
                logSys.error("Errors in jail %r. Skipping..." % sec)
                parse_status = False
        return parse_status
Beispiel #5
0
    def getOptions(self, section=None):
        opts = []
        self.__opts = ConfigReader.getOptions(self, "Definition", opts)

        if section:
            # Get the options of a specific jail.
            jail = JailReader(section)
            jail.read()
            ret = jail.getOptions()
            if ret:
                if jail.isEnabled():
                    # We only add enabled jails
                    self.__jails.append(jail)
            else:
                logSys.error("Errors in jail '%s'. Skipping..." % section)
                return False
        else:
            # Get the options of all jails.
            for sec in self.sections():
                jail = JailReader(sec)
                jail.read()
                ret = jail.getOptions()
                if ret:
                    if jail.isEnabled():
                        # We only add enabled jails
                        self.__jails.append(jail)
                else:
                    logSys.error("Errors in jail '" + sec + "'. Skipping...")
                    return False
        return True