Beispiel #1
0
    def _read_whitelist_configs(self):
        config_storage = self.storage_factory(partition=None)
        config_storage.open()

        # Whitelists
        self.building_blocks = self._parse_whitelist(
            config_storage["building_blocks"]
            or api_ttypes.CodeIdentifierList())
        self.third_party_whitelist = self._parse_whitelist(
            config_storage["third_party_whitelist"]
            or api_ttypes.CodeIdentifierList())
        self.known_errors = self._parse_whitelist(
            config_storage["known_errors"] or api_ttypes.KnownErrorList())
        self.ignored_exceptions = set(
            (config_storage["ignored_exceptions"]
             or api_ttypes.IgnoredExceptionList()).exceptions)

        # Watchers
        self.watch_all_errors, self.watch_only_if_blamed = self._parse_watchers_file(
            config_storage["watch_list"] or api_ttypes.WatchList())

        # Email remapping
        self.email_remapping = config_storage[
            "email_remapping"] or api_ttypes.EmailRemapping()

        config_storage.close()
Beispiel #2
0
 def save_remap_email(self, request):
     params = dict(urlparse.parse_qsl(request))
     config_storage = self.storage_factory(partition=None)
     config_storage.open()
     current_value = config_storage["email_remapping"] or api_ttypes.EmailRemapping()
     current_value.remap[params["old_email"]] = params["new_email"]
     current_value.last_update_ts = self._epoch_ms()
     config_storage["email_remapping"] = current_value
     config_storage.sync()
     config_storage.close()
     return "<html><body>SUCCESS</body></html>"