~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/client.py

  • Committer: Curtis Hovey
  • Date: 2012-03-16 19:49:31 UTC
  • Revision ID: curtis.hovey@canonical.com-20120316194931-xngt1fdw9ewovwqn
Use PUT for creating messages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
)
8
8
 
9
9
from grackle.error import (
10
 
    ArchiveIdExists,
11
10
    MessageIdNotFound,
12
11
    UnparsableDateRange,
13
12
    UnsupportedDisplayType,
56
55
        :param mbox: An optional mbox with messages to add to the new archive.
57
56
        """
58
57
        response = self._method_archive(
59
 
            'PUT', archive_id, {}, None)
 
58
            'POST', '', {'archive_id': archive_id}, None)
60
59
        response.read()
61
60
        if response.status == httplib.BAD_REQUEST:
62
 
            if response.reason == ArchiveIdExists.__doc__:
63
 
                raise ArchiveIdExists
64
61
            raise Exception('wtf')
65
62
        elif response.status == httplib.CREATED:
66
63
            return
80
77
            'PUT', path, {}, file_obj.read())
81
78
        response.read()
82
79
        if response.status == httplib.BAD_REQUEST:
83
 
            if response.reason == ArchiveIdExists.__doc__:
84
 
                raise ArchiveIdExists
85
80
            raise Exception('wtf')
86
81
        elif response.status == httplib.CREATED:
87
82
            return