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

Passing a dict of metadata to create_node method of GCE driver doesn't work.

    Details

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

      Description

      GCE requires metadata to be sent in the following way:

      metadata = {"items": [

      {"value": "val1", "key": "key1"}

      ,

      {"value": "val2", "key": "key2"}

      ]}

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

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

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

        GitHub user raphtheb opened a pull request:

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

        LIBCLOUD-544 Resolve a bug introduced by the original fix of the issue...

        This is meant to replace github.com/apache/libcloud/pull/349
        With one clean commit.

        1- Add separated verifications for "None" and malformed metadata.
        A clear error will be raised upon malformed metadata.
        If undefined or already None, we assume None.
        2- Provide comments explaining the odd GCE dictionary format.
        3- Perform check on metadata dictionary structure. We expect one "items" key
        and a tuple of arbitrary values.
        4- Prefix the keys/values provided by a simple dictionary by "items" if not
        found, enforcing point 3's structure.

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

        $ git pull https://github.com/raphtheb/libcloud LIBCLOUD-544_gce_metadata_squashed

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

        https://github.com/apache/libcloud/pull/353.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 #353


        commit 652f59aa3747ce78f6db5b82097ce8ded3c4e6d4
        Author: rtheberge <raphael.theberge@bhvr.com>
        Date: 2014-08-29T13:41:14Z

        LIBCLOUD-544 Resolve a bug introduced by the original fix of the issue.

        1- Add separated verifications for "None" and malformed metadata.
        A clear error will be raised upon malformed metadata.
        If undefined or already None, we assume None.
        2- Provide comments explaining the odd GCE dictionary format.
        3- Perform check on metadata dictionary structure. We expect one "items" key
        and a tuple of arbitrary values.
        4- Prefix the keys/values provided by a simple dictionary by "items" if not
        found, enforcing point 3's structure.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user raphtheb opened a pull request: https://github.com/apache/libcloud/pull/353 LIBCLOUD-544 Resolve a bug introduced by the original fix of the issue... This is meant to replace github.com/apache/libcloud/pull/349 With one clean commit. 1- Add separated verifications for "None" and malformed metadata. A clear error will be raised upon malformed metadata. If undefined or already None, we assume None. 2- Provide comments explaining the odd GCE dictionary format. 3- Perform check on metadata dictionary structure. We expect one "items" key and a tuple of arbitrary values. 4- Prefix the keys/values provided by a simple dictionary by "items" if not found, enforcing point 3's structure. You can merge this pull request into a Git repository by running: $ git pull https://github.com/raphtheb/libcloud LIBCLOUD-544 _gce_metadata_squashed Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/353.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 #353 commit 652f59aa3747ce78f6db5b82097ce8ded3c4e6d4 Author: rtheberge <raphael.theberge@bhvr.com> Date: 2014-08-29T13:41:14Z LIBCLOUD-544 Resolve a bug introduced by the original fix of the issue. 1- Add separated verifications for "None" and malformed metadata. A clear error will be raised upon malformed metadata. If undefined or already None, we assume None. 2- Provide comments explaining the odd GCE dictionary format. 3- Perform check on metadata dictionary structure. We expect one "items" key and a tuple of arbitrary values. 4- Prefix the keys/values provided by a simple dictionary by "items" if not found, enforcing point 3's structure.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user raphtheb closed the pull request at:

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

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

        GitHub user raphtheb opened a pull request:

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

        LIBCLOUD-544 Fix the regression caused by the original implementation ...

        ...of the bugfix. We now perform a simple sanity check to know whether the metadata dictionary has already been formatted to GCE's specs.

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

        $ git pull https://github.com/raphtheb/libcloud LIBCLOUD-544_gce_metadata_fix

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

        https://github.com/apache/libcloud/pull/348.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 #348


        commit 0efaf9d2ab2bb86ec286fadeb9a24e64d09416db
        Author: rtheberge <raphael.theberge@bhvr.com>
        Date: 2014-08-15T18:20:14Z

        LIBCLOUD-544 Fix the regression caused by the original implementation of the bugfix. We now perform a simple sanity check to know whether the metadata dictionary has already been formatted to GCE's specs.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user raphtheb opened a pull request: https://github.com/apache/libcloud/pull/348 LIBCLOUD-544 Fix the regression caused by the original implementation ... ...of the bugfix. We now perform a simple sanity check to know whether the metadata dictionary has already been formatted to GCE's specs. You can merge this pull request into a Git repository by running: $ git pull https://github.com/raphtheb/libcloud LIBCLOUD-544 _gce_metadata_fix Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/348.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 #348 commit 0efaf9d2ab2bb86ec286fadeb9a24e64d09416db Author: rtheberge <raphael.theberge@bhvr.com> Date: 2014-08-15T18:20:14Z LIBCLOUD-544 Fix the regression caused by the original implementation of the bugfix. We now perform a simple sanity check to know whether the metadata dictionary has already been formatted to GCE's specs.
        Show
        Zerthimon Lior Goikhburg added a comment - https://github.com/apache/libcloud/commit/f3792b2dca835c548bdbce0da2eb71bfc9463b72
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

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

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

        GitHub user zerthimon opened a pull request:

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

        LIBCLOUD-544 GCE: fix adding node metadata at node creation

        Passing a simple metadata dict to create_node GCE driver method doesn't work.
        GCE api requires the following structure for metadata:
        metadata = {"items": [

        {"value": "val1", "key": "key1"}

        ,

        {"value": "val2", "key": "key2"}

        ]}

        This fix converts simple dict to what the API wants.

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

        $ git pull https://github.com/zerthimon/libcloud LIBCLOUD-544_metadata

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

        https://github.com/apache/libcloud/pull/283.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 #283


        commit 1d7fa2983f660ca0cb4d48a9bf420322b8b872ba
        Author: Lior Goikhburg <goikhburg@gmail.com>
        Date: 2014-04-28T14:18:27Z

        LIBCLOUD-544 GCE: fix adding node metadata at node creation


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user zerthimon opened a pull request: https://github.com/apache/libcloud/pull/283 LIBCLOUD-544 GCE: fix adding node metadata at node creation Passing a simple metadata dict to create_node GCE driver method doesn't work. GCE api requires the following structure for metadata: metadata = {"items": [ {"value": "val1", "key": "key1"} , {"value": "val2", "key": "key2"} ]} This fix converts simple dict to what the API wants. You can merge this pull request into a Git repository by running: $ git pull https://github.com/zerthimon/libcloud LIBCLOUD-544 _metadata Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/283.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 #283 commit 1d7fa2983f660ca0cb4d48a9bf420322b8b872ba Author: Lior Goikhburg <goikhburg@gmail.com> Date: 2014-04-28T14:18:27Z LIBCLOUD-544 GCE: fix adding node metadata at node creation

          People

          • Assignee:
            Unassigned
            Reporter:
            Zerthimon Lior Goikhburg
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development