Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-612

Google Storage: tags can't be read/written

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:

      Description

      Setting tags via upload_object(..., extra=dict(meta_data=

      {...}

      )) and reading them via get_object('foo').meta_data doesn't work in the Google Storage driver. From what I see in the code this is caused by BaseS3StorageDriver._headers_to_object, which expects the meta data headers to be prefixed with 'x-amz-meta-'. I checked the libcloud debug output and on Google Storage they are prefixed with 'x-goog-meta-'.

      Should the Google driver override the method (although it's private) or should BaseS3StorageDriver._headers_to_object accept both prefixes? Or something else? Depending on what the preferred solution is, I would make a pullrequest for this.

      Is there ongoing work to have a Google Storage Driver using the native Google API?

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user sfriesel opened a pull request:

        https://github.com/apache/libcloud/pull/356

        LIBCLOUD-612 Customize HTTP vendor prefix for Google Storage

        https://issues.apache.org/jira/browse/LIBCLOUD-612

        Google storage uses/expects custom headers like meta data
        and storage class to be prefixed with "x-goog" instead of
        "x-amz". This enables use of object tagging in the Google
        Storage provider.

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/sfriesel/libcloud gs_meta_data

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/libcloud/pull/356.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #356


        commit 4b4ed2b578f12387f7abafabacbd8ff9164e598f
        Author: Stefan Friesel <sf@cloudcontrol.de>
        Date: 2014-09-09T16:23:34Z

        Customize HTTP vendor prefix for Google Storage

        Google storage uses/expects custom headers like meta data
        and storage class to be prefixed with "x-goog" instead of
        "x-amz". This enables use of object tagging in the Google
        Storage provider.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user sfriesel opened a pull request: https://github.com/apache/libcloud/pull/356 LIBCLOUD-612 Customize HTTP vendor prefix for Google Storage https://issues.apache.org/jira/browse/LIBCLOUD-612 Google storage uses/expects custom headers like meta data and storage class to be prefixed with "x-goog" instead of "x-amz". This enables use of object tagging in the Google Storage provider. You can merge this pull request into a Git repository by running: $ git pull https://github.com/sfriesel/libcloud gs_meta_data Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/356.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #356 commit 4b4ed2b578f12387f7abafabacbd8ff9164e598f Author: Stefan Friesel <sf@cloudcontrol.de> Date: 2014-09-09T16:23:34Z Customize HTTP vendor prefix for Google Storage Google storage uses/expects custom headers like meta data and storage class to be prefixed with "x-goog" instead of "x-amz". This enables use of object tagging in the Google Storage provider.
        Hide
        sfriesel Stefan Friesel added a comment -

        I opened a PR (https://github.com/apache/libcloud/pull/356) with a alternative solution using a custom header prefix as I noticed Google also replaced "X-AMZ-Storage-Class:" with "X-Goog-Storage-Class:", same for ACL (https://developers.google.com/storage/docs/reference-methods).

        Show
        sfriesel Stefan Friesel added a comment - I opened a PR ( https://github.com/apache/libcloud/pull/356 ) with a alternative solution using a custom header prefix as I noticed Google also replaced "X-AMZ-Storage-Class:" with "X-Goog-Storage-Class:", same for ACL ( https://developers.google.com/storage/docs/reference-methods ).
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/libcloud/pull/356

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/libcloud/pull/356

          People

          • Assignee:
            erjohnso Eric Johnson
            Reporter:
            sfriesel Stefan Friesel
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development