Code review comment for lp://staging/~joetalbott/ubuntu-ci-services-itself/data-store

Revision history for this message
Andy Doan (doanac) wrote :

On 12/06/2013 08:08 AM, Joe Talbott wrote:
> +put_file(filename, private=False)
> + Add a file to the data store.

Does this need logic to deal with the remote path on disk versus the
relative path in Swift? I'm not sure the mechanics in swift but maybe a
simpler approach would be something like:

  def create_file(filename, private=False):
      # do something to create a Python FD.
      yield fd

Then your logic for creating files might look like:

with open(resource, 'r') inf:
     with ds.create_file('/bad_example.log') as outf:
         outf.write(inf.read())

This might not make any sense in swift though.

> +get_file(filename)
> + Get a file from the data store.

« Back to merge proposal