You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by hcs42 <gi...@git.apache.org> on 2014/05/27 16:36:59 UTC

[GitHub] libcloud pull request: Fix various bugs and add "floating IP handl...

GitHub user hcs42 opened a pull request:

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

    Fix various bugs and add "floating IP handler" to the OpenStack provider

    This commit contains:
    
    - Fixes of typos in docstrings and comments
    - 7 various small bugfixes
    - a small feature (add "floating IP handler" to the OpenStack provider)
    - a small addition to the DUMMY provider
    
    If I should break up this pull request into several pull requests and/or I should write Jira tickets, just let me know.


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

    $ git pull https://github.com/hcs42/libcloud bugfixes

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

    https://github.com/apache/libcloud/pull/301.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 #301
    
----
commit e1ef1b8b09dc864ca1e8494e92876fd69d17d158
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-04-10T09:33:33Z

    Fix typos in docstrings

commit 7e15c16ea9ee94d845894c137e66b710f7902313
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-05-23T15:16:36Z

    Fix typo in comment

commit 959dc73ca1b8e9f7366e7cea0429edb98a069ab6
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-04-09T11:26:55Z

    Fix import key in EC2 driver
    
    The original code was faulty, because the
    ex_find_or_import_keypair_by_key_material function returned a key pair object,
    and that object was placed in params['KeyName'], which was later expected to
    contain only the key name, not the key pair object.
    
    This fix places only the key name in params['KeyName'].

commit 949e35189a3ff74cad51671988b1b2a9b7d66385
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-04-11T11:37:35Z

    Bugfix: fix variable name in EC2 driver
    
    "id" is a built-in function in Python, which caused this error to slip through
    the unit tests.

commit c10cdc654b31d8897451d9a443271367de044b23
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-05-23T15:18:41Z

    Fix ec2.import_key_pair_from_string for Python 3
    
    In Python 3, the original code didn't work, because base64key was a byte
    string, and it became a value in the `params` dictionary, but that needs
    strings as values.

commit bf831a8a93913648b09363f0dd79a0138ef9674d
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-05-27T11:53:11Z

    Fix publickey._to_md5_fingerprint for Python 3
    
    In Python 3, the original code didn't work, because there is no `encode`
    function for binaries:
    
        (Python3.3)>>> [x.encode("hex") for x in b"abc"]
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "<stdin>", line 1, in <listcomp>
        AttributeError: 'int' object has no attribute 'encode'
    
    String do have an `encode` method, but it is a different function from the
    `encode` in Python 2:
    
        (Python3.3)>>> [x.encode("hex") for x in "abc"]
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "<stdin>", line 1, in <listcomp>
        LookupError: unknown encoding: hex
    
    So I added a "hexadigits" function to our compatibility module (py3) and used
    that in _to_md5_fingerprint.

commit b19ef1ec29a957ba0e45c5b40d100f3d345d677f
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-05-27T12:05:28Z

    Fix publickey.get_pubkey_ssh2_fingerprint for Python 3
    
    In Python 3, the original code didn't work, because there we cannot concatenate
    a string and a byte string.
    
    The new code produces two binaries in Python 3 and two string in Python 2, so
    they can be concatenated in both versions.

commit eb48aa0563d6ebe62737ad822f839ef67c9dc312
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-04-09T14:30:48Z

    Add import_key_pair_from_string to DummyNodeDriver

commit f9f184bad7b3801ebd3ec3e72e6a6817eb286057
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-04-16T08:21:10Z

    ec2 driver: Make cidr_ips argument mandatory
    
    If the cidr_ips parameter in this function is None, and therefore the
    IpPermissions.1.IpRanges.1.CidrIp is not present in the request to the EC2 API,
    the request is not performed. (The response does not indicate an error, but the
    security rule is not created).
    
    This behaviour is not documented in
    http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-AuthorizeSecurityGroupIngress.html,
    but it is reproducable.
    
    The following request didn't work:
    
        Action=AuthorizeSecurityGroupIngress
        GroupId=sg-a4b44ece
        IpPermissions.1.FromPort=22
        IpPermissions.1.IpProtocol=tcp
        IpPermissions.1.ToPort=22
        AWSAccessKeyId=...
        Signature=...
        SignatureMethod=HmacSHA256
        SignatureVersion=2
        Timestamp=2014-04-16T07%3A43%3A21Z
        Version=2013-10-15
    
    While this one did (the only difference is adding CidrIp):
    
        Action=AuthorizeSecurityGroupIngress
        GroupId=sg-a4b44ece
        IpPermissions.1.FromPort=22
        IpPermissions.1.IpProtocol=tcp
        IpPermissions.1.ToPort=22
        IpPermissions.1.IpRanges.1.CidrIp=0.0.0.0/0
        AWSAccessKeyId=...
        Signature=...
        SignatureMethod=HmacSHA256
        SignatureVersion=2
        Timestamp=2014-04-16T07%3A43%3A21Z
        Version=2013-10-15

commit 805940204c121fe2b2106aaad957eab6a19c711b
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-05-06T13:57:53Z

    Add "floating IP handler" to the OpenStack provider
    
    The Compute API of the HP Cloud used by Libcloud [1] does not support floating IP
    pools, but it does support floating IPs. (To be more precise, one needs to use
    floating IPs if he wants to access the instance from outside the cloud.)
    
    So I created a class called OpenStack_1_1_FloatingIpHandler, which handles
    floating IPs without a floating IP pool. To minimize code duplication, this
    class subclasses OpenStack_1_1_FloatingIpPool and overrides only the method
    that needs to be different. (The HP Cloud won't work if a 'pool' parameter is
    passed in the '/os-floating-ips' query, thus we need to override
    the create_floating_ip method.)
    
    [1] HP Helion Public Cloud v13.5 Compute Service:
    https://docs.hpcloud.com/api/v13/compute/#3.10Extensions

commit b778c2141ab0527e055413111b8a1e58b0cd385b
Author: Csaba Hoch <cs...@erlang-solutions.com>
Date:   2014-05-10T13:56:10Z

    OpenStack/delete security group: Accept ACCEPTED
    
    According to https://wiki.openstack.org/wiki/Os-security-groups#Delete_Security_Group
    and my own experiments with the HP cloud, the provider's answer upon success is
    not NO_CONTENT (HTTP status code 204) but ACCEPTED (HTTP status code 202).
    
    So I modified to code to accept ACCEPTED. I still kept NO_CONTENT (I would
    think it was put there because some provider did return NO_CONTENT).

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] libcloud pull request: Fix various bugs and add "floating IP handl...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---