Repository: libcloud Updated Branches: refs/heads/trunk 49536da89 -> dcfe4d9f8
Add ex_revoke_security_group_ingress method to the CloudStack driver and a work-around for a nasty inconsistency bug in CloudStack. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/dcfe4d9f Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/dcfe4d9f Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/dcfe4d9f Branch: refs/heads/trunk Commit: dcfe4d9f88dcc948f13a5d6d291837fc64fa51ec Parents: 49536da Author: Tomaz Muraus <to...@apache.org> Authored: Wed Mar 26 12:02:54 2014 +0100 Committer: Tomaz Muraus <to...@apache.org> Committed: Wed Mar 26 12:10:04 2014 +0100 ---------------------------------------------------------------------- CHANGES.rst | 3 +++ libcloud/common/cloudstack.py | 5 ++++- libcloud/compute/drivers/cloudstack.py | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/dcfe4d9f/CHANGES.rst ---------------------------------------------------------------------- diff --git a/CHANGES.rst b/CHANGES.rst index 744b7fc..b98df33 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -73,6 +73,9 @@ Compute (GITHUB-264) [Franck Cuny] +- Add ex_revoke_security_group_ingress method to the CloudStack driver. + [Chris DeRamus, Tomaz Muraus] + Load Balancer ~~~~~~~~~~~~~ http://git-wip-us.apache.org/repos/asf/libcloud/blob/dcfe4d9f/libcloud/common/cloudstack.py ---------------------------------------------------------------------- diff --git a/libcloud/common/cloudstack.py b/libcloud/common/cloudstack.py index 65810af..99699d0 100644 --- a/libcloud/common/cloudstack.py +++ b/libcloud/common/cloudstack.py @@ -156,7 +156,10 @@ class CloudStackConnection(ConnectionUserAndKey, PollingConnection): result = self.request(action=self.driver.path, params=params, data=data, headers=headers, method=method) - command = command.lower() + 'response' + command = command.lower() + + if command not in ['revokesecuritygroupingress']: + command = command + 'response' if command not in result.object: raise MalformedResponseError( http://git-wip-us.apache.org/repos/asf/libcloud/blob/dcfe4d9f/libcloud/compute/drivers/cloudstack.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py index 83e09b8..c68c884 100644 --- a/libcloud/compute/drivers/cloudstack.py +++ b/libcloud/compute/drivers/cloudstack.py @@ -1752,6 +1752,21 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver): params=args, method='GET')['securitygroup'] + def ex_revoke_security_group_ingress(self, rule_id): + """ + Revoke/delete an ingress security rule + + :param id: The ID of the ingress security rule + :type id: ``str`` + + :rtype: ``bool`` + """ + + self._async_request(command='revokeSecurityGroupIngress', + params={'id': rule_id}, + method='GET') + return True + def ex_register_iso(self, name, url, location=None, **kwargs): """ Registers an existing ISO by URL.