~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/client.py

  • Committer: Curtis Hovey
  • Date: 2012-03-16 20:25:49 UTC
  • Revision ID: curtis.hovey@canonical.com-20120316202549-2dqmxc2f8d9dr7k9
Raise an error when the archive already exists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
)
8
8
 
9
9
from grackle.error import (
 
10
    ArchiveIdExists,
10
11
    MessageIdNotFound,
11
12
    UnparsableDateRange,
12
13
    UnsupportedDisplayType,
58
59
            'PUT', archive_id, {}, None)
59
60
        response.read()
60
61
        if response.status == httplib.BAD_REQUEST:
 
62
            if response.reason == ArchiveIdExists.__doc__:
 
63
                raise ArchiveIdExists
61
64
            raise Exception('wtf')
62
65
        elif response.status == httplib.CREATED:
63
66
            return
77
80
            'PUT', path, {}, file_obj.read())
78
81
        response.read()
79
82
        if response.status == httplib.BAD_REQUEST:
 
83
            if response.reason == ArchiveIdExists.__doc__:
 
84
                raise ArchiveIdExists
80
85
            raise Exception('wtf')
81
86
        elif response.status == httplib.CREATED:
82
87
            return