~hazmat/pyjuju/rapi-delta

« back to all changes in this revision

Viewing changes to juju/providers/openstack/files.py

  • Committer: Kapil Thangavelu
  • Date: 2012-09-19 20:38:44 UTC
  • mfrom: (573.1.6 rest-context)
  • Revision ID: kapil@canonical.com-20120919203844-dc2pf82ttm7xj3xs
Merged rest-context into rapi-delta.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
from cStringIO import StringIO
27
27
 
28
 
from twisted.internet import defer
 
28
from twisted.internet.defer import inlineCallbacks, returnValue
29
29
 
30
30
from juju import errors
31
31
 
40
40
    def get_url(self, name):
41
41
        return self._swift.public_object_url(self._container, name)
42
42
 
43
 
    @defer.inlineCallbacks
 
43
    @inlineCallbacks
44
44
    def get(self, name):
45
45
        """Get a file object from Swift.
46
46
 
57
57
        if response.code != 200:
58
58
            raise errors.ProviderInteractionError(
59
59
                "Couldn't fetch object %r %r" % (response.code, body))
60
 
        defer.returnValue(StringIO(body))
 
60
        returnValue(StringIO(body))
61
61
 
62
 
    @defer.inlineCallbacks
 
62
    @inlineCallbacks
63
63
    def put(self, remote_path, file_object):
64
64
        """Upload a file to Swift.
65
65