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

Opsource driver doesn't put public ip in Nodes

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.13.1
    • Component/s: Compute
    • Labels:
      None

      Description

      When calling list_nodes() from an OpsourceNodeDriver instance, the nodes listed do not contain a public IP ever. The public IP is available in the XML response from the API

      1. debug.txt
        2 kB
        Michael Bennett

        Activity

        Hide
        kami Tomaz Muraus added a comment -
        Show
        kami Tomaz Muraus added a comment - Can you please provide the sample output (using LIBCLOUD_DEBUG https://ci.apache.org/projects/libcloud/docs/troubleshooting.html#debugging)? Fixtures we have in Libcloud ( https://github.com/apache/libcloud/blob/trunk/libcloud/test/compute/fixtures/opsource/oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed.xml ) don't seem to include a public IP address.
        Hide
        bennettaur Michael Bennett added a comment - - edited

        I've attached a sample debug log and I've stripped out all irrelevant lines. As you can see, the response contains a <publicIpAddress> element that contains the valid IP address of my running node. Line 585 in the opsource driver simply returns an empty list and never checks for the public IP. https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/opsource.py#L585

        I've created a pull request with my changes and included a test (which also adds public IP to the test fixture):
        https://github.com/apache/libcloud/pull/137
        (Please ignore pull request 136 as I have deleted the commit for it in my branch. I made a mistake in my code that added an empty string to the public IP list when calling findtext for the public ip returns None)

        Show
        bennettaur Michael Bennett added a comment - - edited I've attached a sample debug log and I've stripped out all irrelevant lines. As you can see, the response contains a <publicIpAddress> element that contains the valid IP address of my running node. Line 585 in the opsource driver simply returns an empty list and never checks for the public IP. https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/opsource.py#L585 I've created a pull request with my changes and included a test (which also adds public IP to the test fixture): https://github.com/apache/libcloud/pull/137 (Please ignore pull request 136 as I have deleted the commit for it in my branch. I made a mistake in my code that added an empty string to the public IP list when calling findtext for the public ip returns None)
        Hide
        kami Tomaz Muraus added a comment -

        I've merged the patch from the corresponding pull request (https://github.com/apache/libcloud/pull/137) into trunk.

        There was also a minor indentation / style issue which I have fixed - https://git-wip-us.apache.org/repos/asf?p=libcloud.git;a=commitdiff;h=7a923be5bd3b3c95e567447f1e35c31abbab5b57.

        Thanks.

        Show
        kami Tomaz Muraus added a comment - I've merged the patch from the corresponding pull request ( https://github.com/apache/libcloud/pull/137 ) into trunk. There was also a minor indentation / style issue which I have fixed - https://git-wip-us.apache.org/repos/asf?p=libcloud.git;a=commitdiff;h=7a923be5bd3b3c95e567447f1e35c31abbab5b57 . Thanks.

          People

          • Assignee:
            kami Tomaz Muraus
            Reporter:
            bennettaur Michael Bennett
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development