Beispiel #1
0
    def save_raw_crash(self, crash_id, raw_crash):
        """Save the raw crash and related dumps.

        FIXME(willkg): How should this method handle exceptions?

        :arg str crash_id: The crash id as a string.
        :arg dict raw_crash: dict The raw crash as a dict.

        """
        self._save_file(self._get_raw_crash_path(crash_id), json_ordered_dumps(raw_crash).encode('utf-8'))
Beispiel #2
0
    def save_raw_crash(self, crash_id, raw_crash):
        """Saves the raw crash and related dumps

        FIXME(willkg): How should this method handle exceptions?

        :arg str crash_id: The crash id as a string.
        :arg dict raw_crash: dict The raw crash as a dict.

        """
        self._save_file(self._get_raw_crash_path(crash_id),
                        json_ordered_dumps(raw_crash).encode('utf-8'))
    def save_dumps(self, crash_id, dumps):
        """Save dump data.

        :arg str crash_id: The crash id
        :arg dict dumps: dump name -> dump

        :raises botocore.exceptions.ClientError: connection issues, permissions
            issues, bucket is missing, etc.

        """
        # Save dump_names even if there are no dumps
        self.conn.save_file(
            self._get_dump_names_path(crash_id),
            json_ordered_dumps(list(sorted(dumps.keys()))).encode('utf-8'))

        # Save dumps
        for dump_name, dump in dumps.items():
            self.conn.save_file(self._get_dump_name_path(crash_id, dump_name),
                                dump)
Beispiel #4
0
    def save_dumps(self, crash_id, dumps):
        """Save dump data.

        :arg str crash_id: The crash id
        :arg dict dumps: dump name -> dump

        """
        files = {}

        # Add dump_names to the list of files to save. We always generate this
        # even if there are no dumps.
        files[self._get_dump_names_path(crash_id)] = json_ordered_dumps(list(sorted(dumps.keys()))).encode('utf-8')

        # Add the dump files if there are any.
        for dump_name, dump in dumps.items():
            files[self._get_dump_name_path(crash_id, dump_name)] = dump

        for fn, contents in files.items():
            self._save_file(fn, contents)
Beispiel #5
0
    def save_dumps(self, crash_id, dumps):
        """Saves dump data

        :arg str crash_id: The crash id
        :arg dict dumps: dump name -> dump

        """
        files = {}

        # Add dump_names to the list of files to save. We always generate this
        # even if there are no dumps.
        files[self._get_dump_names_path(crash_id)] = json_ordered_dumps(
            list(sorted(dumps.keys()))).encode('utf-8')

        # Add the dump files if there are any.
        for dump_name, dump in dumps.items():
            files[self._get_dump_name_path(crash_id, dump_name)] = dump

        for fn, contents in files.items():
            self._save_file(fn, contents)
Beispiel #6
0
    def save_dumps(self, crash_id, dumps):
        """Saves dump data

        :arg str crash_id: The crash id
        :arg dict dumps: dump name -> dump

        :raises botocore.exceptions.ClientError: connection issues, permissions
            issues, bucket is missing, etc.

        """
        # Save dump_names even if there are no dumps
        self.conn.save_file(
            self._get_dump_names_path(crash_id),
            json_ordered_dumps(list(sorted(dumps.keys()))).encode('utf-8')
        )

        # Save dumps
        for dump_name, dump in dumps.items():
            self.conn.save_file(
                self._get_dump_name_path(crash_id, dump_name),
                dump
            )
    def save_raw_crash(self, crash_id, raw_crash):
        """Save the raw crash and related dumps.

        .. Note::

           If you're saving the raw crash and dumps, make sure to save the raw
           crash last.

        :arg str crash_id: The crash id as a string.
        :arg dict raw_crash: dict The raw crash as a dict.

        :raises botocore.exceptions.ClientError: connection issues, permissions
            issues, bucket is missing, etc.

        """
        # FIXME(willkg): self.conn.save_file raises a
        # botocore.exceptions.ClientError if the perms aren't right. That needs
        # to surface to "this node is not healthy".

        # Save raw_crash
        self.conn.save_file(self._get_raw_crash_path(crash_id),
                            json_ordered_dumps(raw_crash).encode('utf-8'))
Beispiel #8
0
    def save_raw_crash(self, crash_id, raw_crash):
        """Saves the raw crash and related dumps

        .. Note::

           If you're saving the raw crash and dumps, make sure to save the raw
           crash last.

        :arg crash_id: The crash id as a string.
        :arg raw_crash: dict The raw crash as a dict.

        :raises botocore.exceptions.ClientError: connection issues, permissions
            issues, bucket is missing, etc.

        """
        # FIXME(willkg): self.conn.save_file raises a
        # botocore.exceptions.ClientError if the perms aren't right. That needs
        # to surface to "this node is not healthy".

        # Save raw_crash
        self.conn.save_file(
            self._get_raw_crash_path(crash_id),
            json_ordered_dumps(raw_crash).encode('utf-8')
        )