Example #1
0
    def _save_userdata(self, metadata):
        """
        Save the given noticeboard metadata to disk.

        @param metadata: repository user metadata to store
        @type metadata: dict
        @raise KeyError: if given repository identifier is not available
        @raise RepositoryError: if given repository directory is not available
        """
        avail_data = self._settings['repositories']['available']
        nb_path = avail_data[self._repository_id]['local_notice_board']

        nb_dir = os.path.dirname(nb_path)
        if not const_dir_writable(nb_dir):
            raise RepositoryError("repository directory not available for %s" %
                                  (self._repository_id, ))

        return dump_dumpobj(nb_path, metadata, complete_path=True)
Example #2
0
    def _save_userdata(self, metadata):
        """
        Save the given noticeboard metadata to disk.

        @param metadata: repository user metadata to store
        @type metadata: dict
        @raise KeyError: if given repository identifier is not available
        @raise RepositoryError: if given repository directory is not available
        """
        avail_data = self._settings['repositories']['available']
        nb_path = avail_data[self._repository_id]['local_notice_board']

        nb_dir = os.path.dirname(nb_path)
        if not const_dir_writable(nb_dir):
            raise RepositoryError(
                "repository directory not available for %s" % (
                    self._repository_id,))

        return dump_dumpobj(nb_path, metadata, complete_path = True)
Example #3
0
    def store_noticeboard_userdata(self, repository_id, metadata):
        """
        Store given noticeboard metadata for given repository to disk.

        @param repository_id: repository identifier
        @type repository_id: string
        @param metadata: repository user metadata to store
        @type metadata: dict
        @raise KeyError: if given repository identifier is not available
        @raise RepositoryError: if given repository directory is not available
        """
        repo_data = self._settings['repositories']['available'][repository_id]
        nb_path = repo_data['local_notice_board_userdata']

        # check availability
        nb_dir = os.path.dirname(nb_path)
        if not const_dir_writable(nb_dir):
            raise RepositoryError(
                "repository directory not available for %s" % (repository_id,))

        return dump_dumpobj(nb_path, metadata, complete_path = True)