John Dewey [Fri, 6 Dec 2013 03:35:37 +0000 (19:35 -0800)]
Removed erronus config file comment
The comment stating 'DHCP agents needs it.' with regards to the
rpc_notifier notification_driver is incorrect. Looking through
the code, I see no place this is true. I believe it to be an
error.
If a network/subnet is deleted while creating the dhcp
port, the agent will detect a conflict on state of the
network and deal with it accordingly.
A concurrent delete may manifest itself via a number
of exceptions, IPAddressGenerationFailure amongst others,
hence the refactoring of the error handling logic into its
own utility method.
There is really no problem with this change. However, it is probably
triggering a port_update notification to the agent for each port
with an allocated IP.
The agent handles that notification in a way which might be improved
from a scalability perspective.
I don't actually want this change to removed, I am just checking
whether neutron without it passess jobs.
This patch adds some debug logging statements aimed at profiling
tasks in the agent's main rpc loop.
These logging capabilities will help gain some better insights into
the performance bottlenecks of the agent.
Zhenguo Niu [Thu, 28 Nov 2013 15:12:00 +0000 (23:12 +0800)]
Updates .gitignore
To ignore swap files from getting into repository
currently the implemented ignores are *.swp and *.swo
however vim adds more swap files if these files exists,
so improving this with *.sw?
Maru Newby [Wed, 27 Nov 2013 07:57:48 +0000 (07:57 +0000)]
Stop logging unnecessary warning on context create
The context was previously logging at the 'warn' level when unknown
kwargs were being passed to its __init__(). Since the agents were
passing tenant=None with each rpc request, this was generating an
unreasonable amount of log chatter that would not be useful to an
operator. The fix is to log at the debug level instead so that
the operators don't see the output by default but developers can
still choose to.
Eugene Nikanorov [Thu, 28 Nov 2013 08:46:41 +0000 (12:46 +0400)]
Avoid loading policy when processing rpc requests
When Neutron server is restarted in the environment where multiple agents
are sending rpc requests to Neutron, it causes loading of policy.json
before API extensions are loaded. That causes different policy check
failures later on.
This patch avoids loading policy when creating a Context in rpc layer.
This fix improves test code coverage for the file:
neutron/plugins/cisco/network_plugin.py
from 34% to 98%.
Some of the changes made to realize this code coverage improvements
are the following:
- Core API methods (create_network, update_network, etc.) have been
removed from the core plugin (network_plugin.py). These methods
are currently unused. Before this change, we relied on the underlying
model layer to inform the core plugin whether or not the model layer
was capable of handling these core API calls itself via a 'MANAGE_STATE'
attribute. However, there is only one existing model layer
implementation (i.e. for Nexus plugin; the N1KV plugin does not use
network_plugin.py), and that model layer supports the core API calls.
Given that it is unlikely that another model layer for the Cisco Nexus
plugin will ever be developed (esp. with the availability of the ML2
plugin), so it makes more sense to delete this untested code.
- Exception raising for non-existent credentials has been removed from
get_credential_details and rename_credential methods since
exceptions are already raised for this condition in lower-level
credential database code.
- The schedule_host, associate_port, and detach_port methods are
deleted because these essentially do nothing useful (log a debug
message and then return None), since these methods look for
the same-named methods in the model layer, but these methods are
not defined in the model layer.
- The helper functions _invoke_device_plugins and _func_name are
deleted because they are no longer used.
- In unit test code for the Cisco QoS and credentials database, calls
are now made indirectly through the core plugin (network_plugin.py)
extension API methods, as a quick-and-easy way to provide code
coverage for these core plugin methods.
Akihiro Motoki [Wed, 27 Nov 2013 10:09:01 +0000 (19:09 +0900)]
Mocking ryu plugin notifier in ryu plugin test
Previously RPC notifier is not mocked in ryu plugin test and the
plugin tries to send RPC notifications. It may interact with
impl_fake RPC set up in previous tests by other plugin
and sometimes leads to unexpected ovs-vsctl invoking.
Maru Newby [Mon, 25 Nov 2013 17:35:54 +0000 (17:35 +0000)]
Fix format errors seen in rpc logging
The previous commit for this bug didn't include the 'project_name'
key in the context dict. The missing key was causing the amqp
module to generate log formatting exceptions instead of normal
log output.
Separately, the context module itself was generating logging
exceptions in the quantum service when logging was attempted
before the context was fully initialized
This patch ensures allowed address pairs bindings are refreshed
only when they actually change.
This will also avoid sending a notification to the agent if no
change actually occured.
This fix improves the unit test coverage for the Cisco Nexus plugin's
cisco_nexus_network_driver_v2.py and cisco_nexus_plugin_v2.py
source files from:
cisco_nexus_network_driver_v2: 72%
cisco_nexus_plugin_v2: 79%
To:
cisco_nexus_network_driver_v2: 99%
cisco_nexus_plugin_v2: 94%
Much of what the remaining "uncovered" code (coverage tool
reports as partially covered) can be attributed to the
coverage tool not being aware that execution does not
continue at the end of a save_and_reraise_exception()
context block (i.e. the exception will be reraised, but
the coverage tool isn't aware of this).
This fix and coverage results are dependent on the fix for #1246080.
Monty Taylor [Mon, 11 Nov 2013 09:30:54 +0000 (04:30 -0500)]
Replace stubout with fixtures
blueprint remove-mox
The last step in removing mox is to remove stubout usage. Lucky for us,
the fixtures library, which we are already using, can take on the
challenge quite well.
dekehn [Thu, 21 Nov 2013 05:03:51 +0000 (22:03 -0700)]
Mock the udevadm in the TunnelTestWithMTU test
When running the neutron.tests.unit.openvswitch.test_ovs_tunnel.
TunnelTestWithMTU unit test failure occurs because the udevadm is
timing out waiting on a mock-ed device.
Avoid dhcp agent race condition on subnet and network delete
Ensure that ports that are about to be deleted are 'selected
for update'. By doing so, we avoid a race condition between
subnet and network delete operations carried out by two
separate server instances.
A race caused by the dhcp agent deleting the DHCP port
(caused by a subnet-delete event notification) can
still occur and will be addressed in a subsequent patch.
delete_subnet's way to delete ports has been tweaked to
ensure that postgres db can handle the SELECT FOR UPDATE
correctly.
Ilya Pekelny [Fri, 22 Nov 2013 12:04:26 +0000 (14:04 +0200)]
Sync openstack.common.local from oslo
`local` has a broken TLS symbol - strong_store, fixed in oslo some time ago in
Ib544be1485823f6c619312fdee5a04031f48bbb4. All direct and indirect
(lockutils and rpc) usages of strong_store might be potentially affected.
Original change to Nova: If4dd973acc23921dbc2bc69bb76225deb2802dad