Exemple #1
0
    def convertParams(self, name, cleaned_params, to_string=False):
        if not self.added_thread_limit_validator:
            # Only allow a thread limit of 25 if this is on cloud
            if ServerInfo.is_on_cloud(session_key=self.getSessionKey()):
                self.field_validators[self.PARAM_THREAD_LIMIT] = IntegerFieldValidator(1, 25)
            else:
                self.field_validators[self.PARAM_THREAD_LIMIT] = IntegerFieldValidator(1, 5000)

            self.added_thread_limit_validator = True

        # Call the super class convertParams()
        return super(WebsiteMonitoringRestHandler, self).convertParams(name, cleaned_params, to_string)
Exemple #2
0
    def handleList(self, confInfo):
        """
        Provide the list of configuration options.

        Arguments
        confInfo -- The object containing the information about what is being requested.
        """

        # Read the current settings from the conf file
        confDict = self.readConf(self.conf_file)

        # Set the settings
        if confDict != None:
            for stanza, settings in confDict.items():
                for key, val in settings.items():
                    if key == self.PARAM_THREAD_LIMIT and int(val) > 25 and ServerInfo.is_on_cloud(session_key=self.getSessionKey()):
                        confInfo[stanza].append(key, 25)
                    else:
                        confInfo[stanza].append(key, val)