[jira] [Commented] (LIBCLOUD-749) CloudStack: bugs in the method ex_authorize_security_group_ingress
[ https://issues.apache.org/jira/browse/LIBCLOUD-749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14952297#comment-14952297 ] ASF subversion and git services commented on LIBCLOUD-749: -- Commit a35bc7e536edc2f2c7c54d8f001d557029170562 in libcloud's branch refs/heads/trunk from lionel [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=a35bc7e ] [LIBCLOUD-749] Fixed a minor issue with the docstring of the method ex_authorize_security_group_ingress Closes #580 Signed-off-by: Tomaz Muraus> CloudStack: bugs in the method ex_authorize_security_group_ingress > -- > > Key: LIBCLOUD-749 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-749 > Project: Libcloud > Issue Type: Bug > Components: Compute > Environment: CloudStack compute driver >Reporter: L. Schaub > Labels: Bug, CloudStack, Improvement, SecurityGroups > Original Estimate: 4h > Remaining Estimate: 4h > > The method ex_authorize_security_group_ingress contains some bugs: > - The docstring doesn't match parameters of the method. > - Only ICMP and TCP is allowed even if the doc of the parameter "protocol" > mention TCP and UDP. > - Moreover ICMP cannot be used because there is no way to specify the two > required parameters "icmptype" and "icmpcode". > - The parameter endport is not used if it's defined. > - The return type is not a list but a dict. > - The unit test doesn't use parameters in the correct order. > So I created a patch which aims to fix these bugs and also try to do the > following: > - Improve the docstring to be a bit more detailed (the previous one comes > from the official Apache CloudStack documentation). > - Add a kwargs to allow to provide extra parameters defined in the API and in > the docstring. > - Improve the unit test. > - Add support for other protocols like AH, GRE, ESP which are available on > some Cloud like Exoscale. > I will provide the patch as a Pull Request in GitHub. > Regards -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (LIBCLOUD-749) CloudStack: bugs in the method ex_authorize_security_group_ingress
[ https://issues.apache.org/jira/browse/LIBCLOUD-749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14952296#comment-14952296 ] ASF subversion and git services commented on LIBCLOUD-749: -- Commit 64876e9fc12d428fba99aafc4d3691db25d60598 in libcloud's branch refs/heads/trunk from lionel [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=64876e9 ] [LIBCLOUD-749] CloudStack: minor fixes to comply with pep8. Closes #580 Signed-off-by: Tomaz Muraus> CloudStack: bugs in the method ex_authorize_security_group_ingress > -- > > Key: LIBCLOUD-749 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-749 > Project: Libcloud > Issue Type: Bug > Components: Compute > Environment: CloudStack compute driver >Reporter: L. Schaub > Labels: Bug, CloudStack, Improvement, SecurityGroups > Original Estimate: 4h > Remaining Estimate: 4h > > The method ex_authorize_security_group_ingress contains some bugs: > - The docstring doesn't match parameters of the method. > - Only ICMP and TCP is allowed even if the doc of the parameter "protocol" > mention TCP and UDP. > - Moreover ICMP cannot be used because there is no way to specify the two > required parameters "icmptype" and "icmpcode". > - The parameter endport is not used if it's defined. > - The return type is not a list but a dict. > - The unit test doesn't use parameters in the correct order. > So I created a patch which aims to fix these bugs and also try to do the > following: > - Improve the docstring to be a bit more detailed (the previous one comes > from the official Apache CloudStack documentation). > - Add a kwargs to allow to provide extra parameters defined in the API and in > the docstring. > - Improve the unit test. > - Add support for other protocols like AH, GRE, ESP which are available on > some Cloud like Exoscale. > I will provide the patch as a Pull Request in GitHub. > Regards -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (LIBCLOUD-749) CloudStack: bugs in the method ex_authorize_security_group_ingress
[ https://issues.apache.org/jira/browse/LIBCLOUD-749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14952298#comment-14952298 ] ASF GitHub Bot commented on LIBCLOUD-749: - Github user asfgit closed the pull request at: https://github.com/apache/libcloud/pull/580 > CloudStack: bugs in the method ex_authorize_security_group_ingress > -- > > Key: LIBCLOUD-749 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-749 > Project: Libcloud > Issue Type: Bug > Components: Compute > Environment: CloudStack compute driver >Reporter: L. Schaub > Labels: Bug, CloudStack, Improvement, SecurityGroups > Original Estimate: 4h > Remaining Estimate: 4h > > The method ex_authorize_security_group_ingress contains some bugs: > - The docstring doesn't match parameters of the method. > - Only ICMP and TCP is allowed even if the doc of the parameter "protocol" > mention TCP and UDP. > - Moreover ICMP cannot be used because there is no way to specify the two > required parameters "icmptype" and "icmpcode". > - The parameter endport is not used if it's defined. > - The return type is not a list but a dict. > - The unit test doesn't use parameters in the correct order. > So I created a patch which aims to fix these bugs and also try to do the > following: > - Improve the docstring to be a bit more detailed (the previous one comes > from the official Apache CloudStack documentation). > - Add a kwargs to allow to provide extra parameters defined in the API and in > the docstring. > - Improve the unit test. > - Add support for other protocols like AH, GRE, ESP which are available on > some Cloud like Exoscale. > I will provide the patch as a Pull Request in GitHub. > Regards -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[GitHub] libcloud pull request: [LIBCLOUD-749] CloudStack: fixed method ex_...
Github user asfgit closed the pull request at: https://github.com/apache/libcloud/pull/580 --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[1/4] libcloud git commit: [LIBCLOUD-749] CloudStack: fixed method ex_authorize_security_group_ingress
Repository: libcloud Updated Branches: refs/heads/trunk e7d1882dd -> d73d4777d [LIBCLOUD-749] CloudStack: fixed method ex_authorize_security_group_ingress Closes #580 Signed-off-by: Tomaz MurausProject: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/550dcf44 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/550dcf44 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/550dcf44 Branch: refs/heads/trunk Commit: 550dcf44f97d73c858f43fe1508b3e42e152da92 Parents: e7d1882 Author: lionel Authored: Tue Sep 15 23:39:15 2015 +0200 Committer: Tomaz Muraus Committed: Sun Oct 11 16:09:23 2015 +0200 -- libcloud/compute/drivers/cloudstack.py | 120 --- .../cloudstack/queryAsyncJobResult_17200.json | 2 +- libcloud/test/compute/test_cloudstack.py| 20 +++- 3 files changed, 93 insertions(+), 49 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/550dcf44/libcloud/compute/drivers/cloudstack.py -- diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py index 1c77b3b..4e5e835 100644 --- a/libcloud/compute/drivers/cloudstack.py +++ b/libcloud/compute/drivers/cloudstack.py @@ -3489,70 +3489,106 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver): params={'name': name}, method='GET')['success'] -def ex_authorize_security_group_ingress(self, securitygroupname, -protocol, cidrlist, startport, -endport=None): +def ex_authorize_security_group_ingress(self, securitygroupname, protocol, +cidrlist, startport=None, endport=None, +icmptype=None, icmpcode=None, **kwargs): """ Creates a new Security Group Ingress rule -:param domainid: An optional domainId for the security group. - If the account parameter is used, - domainId must also be used. -:type domainid: ``str`` +:param securitygroupname: The name of the security group. +Mutually exclusive with securitygroupid. +:typesecuritygroupname: ``str`` -:param startport: Start port for this ingress rule -:type startport: ``int`` +:param protocol: Can be TCP, UDP or ICMP. + Sometime other protocols can be used like AH, ESP + or GRE. +:typeprotocol: ``str`` -:param securitygroupid: The ID of the security group. -Mutually exclusive with securityGroupName -parameter -:type securitygroupid: ``str`` +:param cidrlist: Source address CIDR for which this rule applies. +:typecidrlist: ``str`` -:param cidrlist: The cidr list associated -:type cidrlist: ``list`` +:param startport: Start port of the range for this ingress rule. +Applies to protocols TCP and UDP. +:typestartport: ``int`` -:param usersecuritygrouplist: user to security group mapping -:type usersecuritygrouplist: ``dict`` +:param endport: End port of the range for this ingress rule. + It can be None to set only one port. + Applies to protocols TCP and UDP. +:typeendport: ``int`` -:param securitygroupname: The name of the security group. - Mutually exclusive with - securityGroupName parameter -:type securitygroupname: ``str`` +:param icmptype: Type of the ICMP packet (eg: 8 for Echo Request). + -1 or None means "all types". + Applies to protocol ICMP. +:typeicmptype: ``int`` -:param account: An optional account for the security group. -Must be used with domainId. -:type account: ``str`` +:param icmpcode: Code of the ICMP packet for the specified type. + If the specified type doesn't require a code set this + value to 0. + -1 or None means "all codes". + Applies to protocol ICMP. +:typeicmpcode: ``int`` -:param icmpcode: Error code for this icmp message -:type icmpcode: ``int`` +:keyword account: An
[3/4] libcloud git commit: [LIBCLOUD-749] Fixed a minor issue with the docstring of the method ex_authorize_security_group_ingress
[LIBCLOUD-749] Fixed a minor issue with the docstring of the method ex_authorize_security_group_ingress Closes #580 Signed-off-by: Tomaz MurausProject: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a35bc7e5 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a35bc7e5 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a35bc7e5 Branch: refs/heads/trunk Commit: a35bc7e536edc2f2c7c54d8f001d557029170562 Parents: 64876e9 Author: lionel Authored: Mon Sep 21 20:30:39 2015 +0200 Committer: Tomaz Muraus Committed: Sun Oct 11 16:09:31 2015 +0200 -- libcloud/compute/drivers/cloudstack.py | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/a35bc7e5/libcloud/compute/drivers/cloudstack.py -- diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py index 0f60195..3c4b243 100644 --- a/libcloud/compute/drivers/cloudstack.py +++ b/libcloud/compute/drivers/cloudstack.py @@ -3540,12 +3540,12 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver): :keyword projectid: An optional project of the security group :typeprojectid: ``str`` -:param securitygroupid: The ID of the security group. -Mutually exclusive with securitygroupname -:type securitygroupid: ``str`` +:keyword securitygroupid: The ID of the security group. + Mutually exclusive with securitygroupname +:typesecuritygroupid: ``str`` -:param usersecuritygrouplist: User to security group mapping -:type usersecuritygrouplist: ``dict`` +:keyword usersecuritygrouplist: User to security group mapping +:typeusersecuritygrouplist: ``dict`` :rtype: ``dict`` """
[2/4] libcloud git commit: [LIBCLOUD-749] CloudStack: minor fixes to comply with pep8.
[LIBCLOUD-749] CloudStack: minor fixes to comply with pep8. Closes #580 Signed-off-by: Tomaz MurausProject: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/64876e9f Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/64876e9f Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/64876e9f Branch: refs/heads/trunk Commit: 64876e9fc12d428fba99aafc4d3691db25d60598 Parents: 550dcf4 Author: lionel Authored: Wed Sep 16 00:08:50 2015 +0200 Committer: Tomaz Muraus Committed: Sun Oct 11 16:09:29 2015 +0200 -- libcloud/compute/drivers/cloudstack.py | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/64876e9f/libcloud/compute/drivers/cloudstack.py -- diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py index 4e5e835..0f60195 100644 --- a/libcloud/compute/drivers/cloudstack.py +++ b/libcloud/compute/drivers/cloudstack.py @@ -3490,8 +3490,9 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver): method='GET')['success'] def ex_authorize_security_group_ingress(self, securitygroupname, protocol, -cidrlist, startport=None, endport=None, -icmptype=None, icmpcode=None, **kwargs): +cidrlist, startport=None, +endport=None, icmptype=None, +icmpcode=None, **kwargs): """ Creates a new Security Group Ingress rule @@ -3522,8 +3523,8 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver): :typeicmptype: ``int`` :param icmpcode: Code of the ICMP packet for the specified type. - If the specified type doesn't require a code set this - value to 0. + If the specified type doesn't require a code set + this value to 0. -1 or None means "all codes". Applies to protocol ICMP. :typeicmpcode: ``int`` @@ -3560,12 +3561,13 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver): if protocol not in ('TCP', 'UDP') and \ (startport is not None or endport is not None): -raise LibcloudError('"startport" and "endport" are only valid with ' -'protocol TCP or UDP.') +raise LibcloudError('"startport" and "endport" are only valid ' +'with protocol TCP or UDP.') -if protocol != 'ICMP' and (icmptype is not None or icmpcode is not None): -raise LibcloudError('"icmptype" and "icmpcode" are only valid with ' -'protocol ICMP.') +if protocol != 'ICMP' and \ +(icmptype is not None or icmpcode is not None): +raise LibcloudError('"icmptype" and "icmpcode" are only valid ' +'with protocol ICMP.') if protocol in ('TCP', 'UDP'): if startport is None:
[4/4] libcloud git commit: Update changelog.
Update changelog. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/d73d4777 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/d73d4777 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/d73d4777 Branch: refs/heads/trunk Commit: d73d4777d2322a8938ff8ef527901c1edabf9cb3 Parents: a35bc7e Author: Tomaz MurausAuthored: Sun Oct 11 16:04:47 2015 +0200 Committer: Tomaz Muraus Committed: Sun Oct 11 16:09:34 2015 +0200 -- CHANGES.rst | 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/d73d4777/CHANGES.rst -- diff --git a/CHANGES.rst b/CHANGES.rst index 1b12aae..f05d2c6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -76,6 +76,11 @@ Compute (GITHUB-595) [Kyle Long] +- Various fixes and improvements in the ``ex_authorize_security_group_ingress`` + in the CloudStack driver. + (LIBCLOUD-749, GITHUB-580) + [Lionel Schaub] + Storage ~~~