summaryrefslogtreecommitdiff
path: root/nova/objects
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2019-05-20 16:26:35 +0100
committerEric Fried <openstack@fried.cc>2020-01-14 21:25:56 +0000
commitf5f73b4c4e00164d3ced8f9def5c9084397bc591 (patch)
tree11b688ef3121efad60c407773b33bfd8a88f72d9 /nova/objects
parent828f3f269162f60c05f1517d193a3c65b99d3c36 (diff)
downloadnova-f5f73b4c4e00164d3ced8f9def5c9084397bc591.tar.gz
nova-net: Kill it
Finish the job by removing all the now-unused modules. This also allows us to - wait for it - kill mox at long last. It's a great day in the parish. Partial-Implements: blueprint remove-nova-network-ussuri Partial-Implements: blueprint mox-removal-ussuri Change-Id: Ia33ec2604b2fc2d3b6830b596cac669cc3ad6c96
Diffstat (limited to 'nova/objects')
-rw-r--r--nova/objects/__init__.py1
-rw-r--r--nova/objects/dns_domain.py72
-rw-r--r--nova/objects/network.py4
-rw-r--r--nova/objects/network_request.py18
4 files changed, 5 insertions, 90 deletions
diff --git a/nova/objects/__init__.py b/nova/objects/__init__.py
index 621c2d2ca6..8ce1514f6f 100644
--- a/nova/objects/__init__.py
+++ b/nova/objects/__init__.py
@@ -33,7 +33,6 @@ def register_all():
__import__('nova.objects.compute_node')
__import__('nova.objects.diagnostics')
__import__('nova.objects.console_auth_token')
- __import__('nova.objects.dns_domain')
__import__('nova.objects.ec2')
__import__('nova.objects.external_event')
__import__('nova.objects.fixed_ip')
diff --git a/nova/objects/dns_domain.py b/nova/objects/dns_domain.py
deleted file mode 100644
index b517c7ec69..0000000000
--- a/nova/objects/dns_domain.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright (C) 2014, Red Hat, Inc.
-#
-# 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.
-
-from nova.db import api as db
-from nova import objects
-from nova.objects import base
-from nova.objects import fields
-
-
-@base.NovaObjectRegistry.register
-class DNSDomain(base.NovaPersistentObject, base.NovaObject):
- # Version 1.0: Initial version
- VERSION = '1.0'
-
- fields = {
- 'domain': fields.StringField(),
- 'scope': fields.StringField(nullable=True),
- 'availability_zone': fields.StringField(nullable=True),
- 'project_id': fields.StringField(nullable=True),
- }
-
- @staticmethod
- def _from_db_object(context, vif, db_vif):
- for field in vif.fields:
- setattr(vif, field, db_vif[field])
- vif._context = context
- vif.obj_reset_changes()
- return vif
-
- @base.remotable_classmethod
- def get_by_domain(cls, context, domain):
- db_dnsd = db.dnsdomain_get(context, domain)
- if db_dnsd:
- return cls._from_db_object(context, cls(), db_dnsd)
-
- @base.remotable_classmethod
- def register_for_zone(cls, context, domain, zone):
- db.dnsdomain_register_for_zone(context, domain, zone)
-
- @base.remotable_classmethod
- def register_for_project(cls, context, domain, project):
- db.dnsdomain_register_for_project(context, domain, project)
-
- @base.remotable_classmethod
- def delete_by_domain(cls, context, domain):
- db.dnsdomain_unregister(context, domain)
-
-
-@base.NovaObjectRegistry.register
-class DNSDomainList(base.ObjectListBase, base.NovaObject):
- # Version 1.0: Initial version
- VERSION = '1.0'
- fields = {
- 'objects': fields.ListOfObjectsField('DNSDomain'),
- }
-
- @base.remotable_classmethod
- def get_all(cls, context):
- db_domains = db.dnsdomain_get_all(context)
- return base.obj_make_list(context, cls(context), objects.DNSDomain,
- db_domains)
diff --git a/nova/objects/network.py b/nova/objects/network.py
index ea35f938a3..eae7824ee9 100644
--- a/nova/objects/network.py
+++ b/nova/objects/network.py
@@ -105,10 +105,8 @@ class Network(obj_base.NovaPersistentObject, obj_base.NovaObject,
db_value = db_network[field]
if field == 'netmask_v6' and db_value is not None:
db_value = network._convert_legacy_ipv6_netmask(db_value)
- if field == 'dhcp_server' and db_value is None:
+ elif field == 'dhcp_server' and db_value is None:
db_value = db_network['gateway']
- if field == 'share_address' and CONF.share_dhcp_address:
- db_value = CONF.share_dhcp_address
network[field] = db_value
network._context = context
diff --git a/nova/objects/network_request.py b/nova/objects/network_request.py
index ff182195cc..ef07d62bf6 100644
--- a/nova/objects/network_request.py
+++ b/nova/objects/network_request.py
@@ -16,7 +16,6 @@ from oslo_utils import versionutils
from nova.objects import base as obj_base
from nova.objects import fields
-from nova import utils
# These are special case enums for the auto-allocate scenario. 'none' means
# do not allocate a network on server create. 'auto' means auto-allocate a
@@ -49,24 +48,15 @@ class NetworkRequest(obj_base.NovaObject):
def obj_load_attr(self, attr):
setattr(self, attr, None)
- # TODO(stephenfin): Drop the two item tuple case when we drop it entirely
def to_tuple(self):
address = str(self.address) if self.address is not None else None
- if utils.is_neutron():
- return self.network_id, address, self.port_id, self.pci_request_id
- else:
- return self.network_id, address
+ return self.network_id, address, self.port_id, self.pci_request_id
- # TODO(stephenfin): Drop the two item tuple case when we drop it entirely
@classmethod
def from_tuple(cls, net_tuple):
- if len(net_tuple) == 4:
- network_id, address, port_id, pci_request_id = net_tuple
- return cls(network_id=network_id, address=address,
- port_id=port_id, pci_request_id=pci_request_id)
- else:
- network_id, address = net_tuple
- return cls(network_id=network_id, address=address)
+ network_id, address, port_id, pci_request_id = net_tuple
+ return cls(network_id=network_id, address=address, port_id=port_id,
+ pci_request_id=pci_request_id)
@property
def auto_allocate(self):