Remove deprecated security_group_default_rules APIs

These were deprecated in Newton:

aaebeb05a0

Apparently we did not have any tests for this code.

Change-Id: I33c18433e57941b26a4abd290b3cd03994d26327
This commit is contained in:
Matt Riedemann 2017-03-20 17:38:00 -04:00
parent 8030b2604d
commit a52c86c203
3 changed files with 1 additions and 96 deletions

View File

@ -43,7 +43,6 @@ from novaclient.v2 import migrations
from novaclient.v2 import networks from novaclient.v2 import networks
from novaclient.v2 import quota_classes from novaclient.v2 import quota_classes
from novaclient.v2 import quotas from novaclient.v2 import quotas
from novaclient.v2 import security_group_default_rules
from novaclient.v2 import security_group_rules from novaclient.v2 import security_group_rules
from novaclient.v2 import security_groups from novaclient.v2 import security_groups
from novaclient.v2 import server_external_events from novaclient.v2 import server_external_events
@ -168,8 +167,6 @@ class Client(object):
self.security_groups = security_groups.SecurityGroupManager(self) self.security_groups = security_groups.SecurityGroupManager(self)
self.security_group_rules = \ self.security_group_rules = \
security_group_rules.SecurityGroupRuleManager(self) security_group_rules.SecurityGroupRuleManager(self)
self.security_group_default_rules = \
security_group_default_rules.SecurityGroupDefaultRuleManager(self)
self.usage = usage.UsageManager(self) self.usage = usage.UsageManager(self)
self.virtual_interfaces = \ self.virtual_interfaces = \
virtual_interfaces.VirtualInterfaceManager(self) virtual_interfaces.VirtualInterfaceManager(self)

View File

@ -1,93 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
Security group default rules interface.
"""
from novaclient import api_versions
from novaclient import base
from novaclient import exceptions
from novaclient.i18n import _
class SecurityGroupDefaultRule(base.Resource):
"""DEPRECATED"""
def __str__(self):
return str(self.id)
def delete(self):
"""
DEPRECATED: Delete this security group default rule.
:returns: An instance of novaclient.base.TupleWithMeta
"""
return self.manager.delete(self)
class SecurityGroupDefaultRuleManager(base.Manager):
"""DEPRECATED"""
resource_class = SecurityGroupDefaultRule
@api_versions.deprecated_after('2.35')
def create(self, ip_protocol=None, from_port=None, to_port=None,
cidr=None):
"""
DEPRECATED: Create a security group default rule
:param ip_protocol: IP protocol, one of 'tcp', 'udp' or 'icmp'
:param from_port: Source port
:param to_port: Destination port
:param cidr: Destination IP address(es) in CIDR notation
"""
try:
from_port = int(from_port)
except (TypeError, ValueError):
raise exceptions.CommandError(_("From port must be an integer."))
try:
to_port = int(to_port)
except (TypeError, ValueError):
raise exceptions.CommandError(_("To port must be an integer."))
if ip_protocol.upper() not in ['TCP', 'UDP', 'ICMP']:
raise exceptions.CommandError(_("IP protocol must be 'tcp', 'udp'"
", or 'icmp'."))
body = {"security_group_default_rule": {
"ip_protocol": ip_protocol,
"from_port": from_port,
"to_port": to_port,
"cidr": cidr}}
return self._create('/os-security-group-default-rules', body,
'security_group_default_rule')
@api_versions.deprecated_after('2.35')
def delete(self, rule):
"""
DEPRECATED: Delete a security group default rule
:param rule: The security group default rule to delete (ID or Class)
:returns: An instance of novaclient.base.TupleWithMeta
"""
return self._delete('/os-security-group-default-rules/%s' %
base.getid(rule))
@api_versions.deprecated_after('2.35')
def list(self):
"""
DEPRECATED: Get a list of all security group default rules
:rtype: list of :class:`SecurityGroupDefaultRule`
"""
return self._list('/os-security-group-default-rules',
'security_group_default_rules')

View File

@ -59,6 +59,7 @@ upgrade:
* novaclient.v2.floating_ip_pools * novaclient.v2.floating_ip_pools
* novaclient.v2.floating_ips_bulk * novaclient.v2.floating_ips_bulk
* novaclient.v2.fping * novaclient.v2.fping
* novaclient.v2.security_group_default_rules
deprecations: deprecations:
- | - |