Removing the word NVP For the most part from the actual code

This commit is contained in:
Matt Dietz
2013-02-22 17:23:00 +00:00
parent ea6f69c6a4
commit d857297043
3 changed files with 19 additions and 20 deletions

View File

@@ -146,7 +146,7 @@ class Subnet(BASEV2, CreatedAt, HasId, HasTenant):
@cidr.expression
def cidr(cls):
return Subnet._cidr
first_ip = sa.Column(sa.LargeBinary())
last_ip = sa.Column(sa.LargeBinary())
ip_version = sa.Column(sa.Integer())
@@ -160,7 +160,7 @@ class Port(BASEV2, CreatedAt, HasId, HasTenant):
network_id = sa.Column(sa.String(36), sa.ForeignKey("quark_networks.id"),
nullable=False)
nvp_id = sa.Column(sa.String(36), nullable=False)
backend_key = sa.Column(sa.String(36), nullable=False)
# Maybe have this for optimizing lookups.
# subnet_id = sa.Column(sa.String(36), sa.ForeignKey("subnets.id"),
# nulllable=False)

View File

@@ -22,7 +22,7 @@ import ConfigParser
import aiclib
from quantum.openstack.common import log as logging
from quark.db import models
#from quark.db import models
from quark import exceptions as quark_exceptions
conn_index = 0
@@ -86,7 +86,7 @@ class NVPDriver(object):
return None
def _get_lswitch_for_network(self, context, network_id):
LOG.debug("Finding the network %s lswitch" % network_id)
LOG.debug("Finding lswitch for network %s" % network_id)
results = self._lswitch_query(context, network_id).results()
LOG.debug(results)
if results["result_count"] > 1:
@@ -164,9 +164,10 @@ class NVPDriver(object):
class OptimizedNVPDriver(NVPDriver):
#def _get_open_lswitch(context, network_id, max_per_switch):
# pass
def _get_open_lswitch(self, context, network_id, max_per_switch):
return super(OptimizedNVPDriver, self)._get_open_lswitch(
context, network_id, max_per_switch)
#def _get_lswitch_for_network(context, network_id):
# pass
pass
def _get_lswitch_for_network(self, context, network_id):
return super(OptimizedNVPDriver, self)._get_lswitch_for_network(
context, network_id)

View File

@@ -288,7 +288,7 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
quantum/api/v2/attributes.py. All keys will be populated.
"""
with context.session.begin(subtransactions=True):
# Generate a uuid that we're going to hand to NVP and the database
# Generate a uuid that we're going to hand to the backend and db
net_uuid = uuidutils.generate_uuid()
#NOTE(mdietz): probably want to abstract this out as we're getting
@@ -432,7 +432,7 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
as listed in the RESOURCE_ATTRIBUTE_MAP object in
quantum/api/v2/attributes.py. All keys will be populated.
"""
LOG.critical("Creating port %s" % port)
LOG.info("Creating port %s" % port)
session = context.session
#TODO(mdietz): do something clever with these
@@ -461,21 +461,19 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
port_id,
context.tenant_id,
self.ipam_reuse_after)
nvp_port = self.net_driver.create_port(context, net_id,
port_id=port_id)
backend_port = self.net_driver.create_port(context, net_id,
port_id=port_id)
new_port = models.Port()
new_port.update(port["port"])
new_port["id"] = port_id
new_port["nvp_id"] = nvp_port["uuid"]
new_port["backend_key"] = backend_port["uuid"]
new_port["fixed_ips"] = [addresses]
new_port["mac_address"] = mac["address"]
#TODO(mdietz): might be worthwhile to store the lswitch UUID
# for the port in the db meta
session.add(new_port)
new_port["mac_address"] = str(netaddr.EUI(new_port["mac_address"],
dialect=netaddr.mac_unix))
LOG.critical("Port created %s" % new_port)
LOG.debug("Port created %s" % new_port)
return self._make_port_dict(new_port)
def update_port(self, context, id, port):
@@ -516,7 +514,7 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
return self._make_port_dict(port)
def _ports_query(self, context, filters, query=None):
LOG.critical("Querying ports for tenant %s with filters %s" %
LOG.info("Querying ports for tenant %s with filters %s" %
(context.tenant_id, filters))
query = query or context.session.query(models.Port)
if filters.get("id"):
@@ -609,13 +607,13 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
raise exceptions.NetworkNotFound(net_id=id)
#TODO(mdietz): need detach, mac and IP release in here, as well
nvp_id = port["nvp_id"]
backend_key = port["backend_key"]
self.ipam_driver.deallocate_mac_address(session,
port["mac_address"],)
self.ipam_driver.deallocate_ip_address(session, id,
ipam_reuse_after=self.ipam_reuse_after)
session.delete(port)
self.net_driver.delete_port(context, nvp_id)
self.net_driver.delete_port(context, backend_key)
def get_mac_address_ranges(self, context):
ranges = context.session.query(models.MacAddressRange).all()