Ihar Hrachyshka [Tue, 6 May 2014 13:52:35 +0000 (15:52 +0200)]
Disable debug messages when running unit tests
Some runs started to fail due to large sub_unit.log files. We should
reduce their size. The easy way to achieve this is to disable INFO
messages that are filling our logs.
Ann Kamyshnikova [Thu, 24 Apr 2014 11:34:45 +0000 (15:34 +0400)]
Fix incorrect usage of sa.String() type
In downgrade of 4eca4a84f08a_remove_ml2_cisco_cred_db migartion
there is a mistake in usage SQLAlchemy String type.
Used sa.string() instead of sa.String()
Jakub Libosvar [Fri, 18 Apr 2014 13:31:55 +0000 (15:31 +0200)]
Fix H302 violations in extensions package
H302 violation is reported by flake8 when importing separated objects from
modules instead of importing the whole module.
e.g. from package.module import function
function()
is changed to
from package import module
module.function()
5b7e61c Dispose db connections pool on disconnect d1988b9 Set sql_mode callback on connect instead of checkout a1a8280 Fix excessive logging from db.sqlalchemy.session 9933bdd Get mysql_sql_mode parameter from config 96a2217 Prevent incorrect usage of _wrap_db_error() 20a7510 Add from_config() method to EngineFacade fea119e Drop special case for MySQL traditional mode, update unit tests dda24eb Introduce mysql_sql_mode option, remove old warning 0b5af67 Introduce a method to set any MySQL session SQL mode 8dccc7b Handle ibm_db_sa DBDuplicateEntry integrity errors 5b9e9f4 Fix doc build errors in db.sqlalchemy ac84a40 Update log translation domains 86707cd Remove None for dict.get() 0545121 Fix duplicating of SQL queries in logs fcf517d Update oslo log messages with translation domains 630d395 Don't use cfg.CONF in oslo.db ce69e7f Don't store engine instances in oslo.db
Earlier Cisco N1kv plugin was using list events api to
poll policies from VSM.
It was inefficient and caused delay in processing.
So, now Cisco N1kv plugin switched to list profiles to
poll policies from VSM.
If one quries NSX doing GET /ws.v1/lswitch/LS_UUID/lport and LS_UUID
is a UUID that does not exist in NSX. NSX raises a 404. If LS_UUID is *
NSX returns an empty result string. This patch fixes the fake_api_client
so that it's behavior is correct.
Carl Baldwin [Wed, 2 Apr 2014 16:53:33 +0000 (16:53 +0000)]
Replace loopingcall in notifier with a delayed send
The loopingcall thread here was started before processes fork and so
the thread stops working after the fork call. This is a problem that
will probably need to be worked out in the long run.
To ensure that this notifier works correctly in all processes, this
change replaces the persistent loopingcall thread with a thread
created on demand to delay and batch up notifications. The first
notification will trigger spawning the thread to wait to send it. Any
notifications that come in the meantime will notice that there is
already a thread waiting to send and will return without spawning.
jasonrad [Fri, 24 Jan 2014 20:43:24 +0000 (15:43 -0500)]
Add 2-leg configuration to Radware LBaaS Driver
Radware's load balancer currently supports three network interfaces.
Prior to this code addition, the configuration of those three
interfaces was: one interface for management, one for high
availability backup, and one for load balancing servers where the
IP that the outside world sees (VIP) and the IP that the servers
respond to (PIP) are identical.
This change adds a new "2-legged" configuration: one interface for
management, one interface for a VIP network, and one interface for the
PIP and the high availability backup network.
During VIP creation, the LBaaS driver detects if the incoming
configuration is "2-legged" by comparing VIP and PIP networks. If they
are different it allocates a new port on the PIP network in order to
obtain an IP address for the PIP and names that port after its
associated VIP ID. vDirect is then directed to create a load balancer
with the PIP network also used as the HA network instead of using the
vDirect container's default HA network configuration.
During VIP deletion, the LBaas driver detects if a port for the PIP
had been previously allocated by searching for and deleting port names
that map to the VIP ID.
allow delete_port to work when there are multiple floating ips
It is possible to associate multiple floating ip addresses with a single
port through the use of multiple *fixed* ip addresses, e.g.:
nova boot ... --nic net-id=my-net-id myserver
nova add-fixed-ip myserver my-net-id
nova add-floating-ip --fixed-address x.x.x.1 myserver y.y.y.y.1
nova add-floating-ip --fixed-address x.x.x.2 myserver y.y.y.y.2
In this situation, neutron.db.l3_db.disassociate_floatingips would throw
an exception:
Exception: Multiple floating IPs found for port <port-id>
This would prevent someone from deleting an instance that was associated
with multiple floating ips.
This patch corrects disassociate_floatingips so that it will
disassociate all floating ips associated with the port, allowing the
delete operation to proceed correctly.
Paul Ward [Fri, 18 Apr 2014 19:57:38 +0000 (14:57 -0500)]
Add nova_ca_certificates_file option to neutron
Previously, neutron had no way to pass a certificates file to the
novaclient. This change is to add that ability, similar to the way
you can pass a certificates file to neutronclient in nova.conf via
neturon_ca_certificates_file.
This forces the object to be ready ahead of accessing time.
The change in loading behavior is also beneficial while listing
routers, as reduces the amount of queries being issued. Tests
show a performance gain of 15-30% for router-list times.
netaddr<=0.7.10 raises ValueError instead of AddrFormatError
This patch is based on Aarons work for the Bug#1308675.
It ensures that ValueError is also caught in addition to
AddrFormatError as in netaddr>=0.7.11 AddrFormatError is raised and
in netaddr<=0.7.10 ValueError is raised.
netaddr<=0.7.10 raises ValueError instead of AddrFormatError
This patch ensures that ValueError is also caught in addition to
AddrFormatError as in netaddr>=0.7.11 AddrFormatError is raised and
in netaddr<=0.7.10 ValueError is raised.
Add a validation to ipv6_ra_mode and ipv6_address_mode with ip
version. An InvalidInput error is prompted when ipv6_ra_mode
or ipv6_address_mode is specified in subnet create and update
API and ip version is 4.
NSX: sync thread catches wrong exceptions on not found
Previously the sync code expected exc.NoResultFound to be raised if a
port/router/network was not found in the database. This is actually not the
correct exception raised. This error will only occur if an element is deleted
from the db right when the sync thead is run for a specific element.
If neutron sends a single event to nova and the server_uuid isn't found
in nova. The python-novaclient will raise a 404 error. This patch ensures
we explicitly catch that exception and use LOG.warning instead of LOG.exception
as this is not an error and can happen when deleting an instance if neutron
detects that the port_status goes down before the port is deleted because
nova first unplugs the vif and then deletes it from neutron.
marios [Fri, 29 Nov 2013 16:23:54 +0000 (18:23 +0200)]
Validate CIDR given as ip-prefix in security-group-rule-create
There was no validation for the provided ip prefix. This just adds
a simple parse using netaddr and explodes with appropriate message.
Also makes sure ip prefix _is_ cidr (192.168.1.1-->192.168.1.1/32).
Validation occurs at the attribute level (API model) as well as at
the db level, where the ethertype is validated against the ip_prefix
address type.
Unit test cases added - bad prefix, unmasked prefix and incorrect
ethertype. Also adds attribute test cases for the added
convert_ip_prefix_to_cidr method
Paul Michali [Fri, 4 Apr 2014 19:14:36 +0000 (19:14 +0000)]
Support enhancements to Cisco CSR VPN REST APIs
Incorporate latest enhancements and fixes in Cisco CSR router REST API
to the VPNaaS device driver and unit test cases. Primarily, is support in
the REST API for different IKE and IPSec encryption algorithms, name length
error handling, disable of anti replay window, and IKE keep alive.
Also includes minor typos and comment fixes mentioned in previous reviews.
Note: notest_cisco_csr_rest.py, which tests the CSR REST client, is not
part of the UT suite yet, pending resolution of httmock package inclusion
as test requirement.
This was probably a copy&paste error. While physical_network is used in
earlier loops, it isn't defined here. The identically named member variable was
probably intended.
There exist a case where deleting router from neutron without
deleting router-interface deletes router from VSD but not from neutron.
If router has an interface with subnet router deletion is not allowed.
Needs to precheck this condition before deleting router from
backend (VSD).