diff --git a/reddwarfclient/security_groups.py b/reddwarfclient/security_groups.py index 7b96f19b..d26cc862 100644 --- a/reddwarfclient/security_groups.py +++ b/reddwarfclient/security_groups.py @@ -59,7 +59,8 @@ class SecurityGroups(base.ManagerWithFind): :rtype: list of :class:`SecurityGroup`. """ - return self._list("/security_groups", "security_groups", limit, marker) + return self._list("/security-groups", "security_groups", limit, + marker) def get(self, security_group): """ @@ -67,7 +68,7 @@ class SecurityGroups(base.ManagerWithFind): :rtype: :class:`SecurityGroup` """ - return self._get("/security_groups/%s" % base.getid(security_group), + return self._get("/security-groups/%s" % base.getid(security_group), "security_group") @@ -104,16 +105,16 @@ class SecurityGroupRules(base.ManagerWithFind): "to_port": to_port, "cidr": cidr }} - return self._create("/security_group_rules", body, + return self._create("/security-group-rules", body, "security_group_rule") def delete(self, security_group_rule): """ - Delete the specified security group. + Delete the specified security group rule. - :param security_group_id: The security group id to delete + :param security_group_rule: The security group rule to delete """ - resp, body = self.api.client.delete("/security_group_rules/%s" % + resp, body = self.api.client.delete("/security-group-rules/%s" % base.getid(security_group_rule)) if resp.status in (422, 500): raise exceptions.from_response(resp, body) diff --git a/tests/test_secgroups.py b/tests/test_secgroups.py index b05a2bbc..25b4de81 100644 --- a/tests/test_secgroups.py +++ b/tests/test_secgroups.py @@ -38,7 +38,7 @@ class SecGroupTest(TestCase): self.security_groups._get = Mock(side_effect=side_effect_func) self.security_group.id = 1 - self.assertEqual(('/security_groups/1', 'security_group'), + self.assertEqual(('/security-groups/1', 'security_group'), self.security_groups.get(self.security_group)) @@ -80,7 +80,7 @@ class SecGroupRuleTest(TestCase): self.security_group_rules._create = Mock(side_effect=side_effect_func) p, b, i = self.security_group_rules.create(1, "tcp", 80, 80, "0.0.0.0//0") - self.assertEqual("/security_group_rules", p) + self.assertEqual("/security-group-rules", p) self.assertEqual("security_group_rule", i) self.assertEqual(1, b["security_group_rule"]["group_id"]) self.assertEqual("tcp", b["security_group_rule"]["protocol"])