Gary Kotton [Tue, 2 Dec 2014 12:35:51 +0000 (04:35 -0800)]
Enforce log hints in opencontrail
This change enforces log hints use and removes debug level log
translation, modifications are validated through a hacking rule
and the change respects loggging guidelines. Validate that hacking
rules apply to directories:- neutron/plugins/opencontrail
Gary Kotton [Tue, 25 Nov 2014 09:46:50 +0000 (01:46 -0800)]
Update i18n translation for Embrane plugin
All the existing LOG.info, LOG.warning, LOG.error and LOG.critical
messages should have _LI, _LW, _LE and _LC respectively. Also, debug
level log shouldn't be translated. This patch set will cover the
embrane directory.
Gary Kotton [Tue, 25 Nov 2014 10:28:54 +0000 (02:28 -0800)]
Update i18n translation for Midonet plugin
All the existing LOG.info, LOG.warning, LOG.error and LOG.critical
messages should have _LI, _LW, _LE and _LC respectively. Also, debug
level log shouldn't be translated. This patch set will cover the midonet
directory.
Cedric Brandily [Tue, 25 Nov 2014 13:30:23 +0000 (13:30 +0000)]
Enforce log hints in neutron.plugins.sriovnicagent
This change enforces log hints use and removes debug level log
translation, modifications are validated through a hacking rule and
the change respects loggging guidelines.
Validate that hacking rules apply to directories:
- neutron/plugins/sriovnicagent
Cedric Brandily [Tue, 25 Nov 2014 12:56:50 +0000 (12:56 +0000)]
Enforce log hints in neutron.plugins.hyperv
This change enforces log hints use and removes debug level log
translation, modifications are validated through a hacking rule and
the change respects loggging guidelines.
Validate that hacking rules apply to directories:
- neutron/plugins/hyperv
Maru Newby [Sat, 8 Nov 2014 17:08:33 +0000 (17:08 +0000)]
Fix base test class for functional api testing
To support in-tree functional api testing, the test class common
across all types of testing can't import modules that define
configuration that Tempest also defines because duplicate
configuration definitions result in runtime errors. A previous change
(I44251db399cd73390a9d1931a7f253662002ba10) moved conflicting imports
to a separate module, but subsequent additions have added new conflicting
imports.
This change creates a new test class that is safe to use for all types
of testing (neutron.tests.sub_base.SubBaseTestCase), ensures that the
existing existing base test class (neutron.tests.base.BaseTestCase)
extends it, and documents their respective responsibilities. This
will hopefully make it less likely that the functional api job will be
broken by changes to the base test class.
Maru Newby [Sat, 8 Nov 2014 17:20:37 +0000 (17:20 +0000)]
Use oslo function for parsing bool from env var
The tests were previously defining their own way of parsing booleans
from strings. This change switches to using a function defined in
the oslo.utils.strutils module.
Russell Bryant [Mon, 1 Dec 2014 20:13:12 +0000 (20:13 +0000)]
Don't block on rpc calls in unit tests
While running unit tests I noticed that all of the test cases from
TestOvsNeutronAgent were taking just over 15 seconds. This is because
it was waiting for the rpc call response timeout. Since the tests
weren't actually failing, it's clear the code doesn't actually care
about the response anyway, so just set the messaging config to not
wait for the response.
On my dev box, this dropped test runtime for this file from 1024
seconds to 3 seconds, which is an obvious *HUGE* improvement.
Someone pointed out that an earlier change
(086496bfc45e01cd2905a074d526a7d513bf4ec2) intended to make calls
return immediately for *all* tests, but removing use of RpcProxy
caused this to stop working.
iptables_manager: Fix get_binary_name for eventlet
The inspect trick used by get_binary_name does not work for
eventlet non-main threads. It's actually the case for ofagent
and in that case it yields something like "greenthread.py",
which is not desirable because this module assumes it different
for each programs. This commit fixes the problem by switching
to use sys.argv.
Russell Bryant [Mon, 1 Dec 2014 19:15:58 +0000 (19:15 +0000)]
Drop old code from SecurityGroupAgentRpcApiMixin
The SecurityGroupAgentRpcApiMixin class temporarily had support for
both RpcProxy and new oslo.messaging style rpc client interfaces. Now
that all users of this mixin have been converted to direct usage of
oslo.messaging APIs, the old compatibility code can be removed.
Russell Bryant [Mon, 1 Dec 2014 18:42:30 +0000 (18:42 +0000)]
Drop RpcProxy usage from ml2 AgentNotifierApi
Remove usage of the RpcProxy compatibility class from the ml2
AgentNotifierApi. The equivalent oslo.messaging APIs are now used
instead. A couple of other mixin APIs had to be converted at the same
time.
Note that there is one very minor functional change here. The base
rpc version is set to '1.0' now instead of '1.1'. The right pattern
to use is to always set the base to be N.0. Any method that needs a
newer version should specify it.
Irena Berezovsky [Sun, 23 Nov 2014 13:39:09 +0000 (15:39 +0200)]
Update i18n translation for Mellanox plugin and agent log msg's
All the existing LOG.info, LOG.warning, LOG.error and LOG.critical
messages should have _LI, _LW, _LE and _LC respectively. Also, debug
level log shouldn't be translated. This patch set will cover the mlnx
directory under neutron/plugins.
Gary Kotton [Thu, 20 Nov 2014 19:53:27 +0000 (11:53 -0800)]
Update i18n translation for VMware NSX plugin log msg's
All the existing LOG.info, LOG.warning, LOG.error and LOG.critical
messages should have _LI, _LW, _LE and _LC respectively. Also, debug
level log shouldn't be translated. This patch set will cover the vmware
directory under neutron/plugins.
Mike Bayer [Mon, 1 Dec 2014 03:18:32 +0000 (22:18 -0500)]
Alter execute_alembic_command() to not assume all commands
Alembic 0.7.1 is adding new diff directives add_fk and remove_fk.
The logic in execute_alembic_command() appears to assume all potential
commands are present in METHODS. This patch adjusts it so that
it checks METHODS first, allowing the tests in neutron.tests.unit.db.test_migration
to pass. However, if the design here requires that all potential
Alembic commands are handled, then this would not be the fix,
though I recommend that the potential list of Alembic directives
not be hardcoded.
Kevin Benton [Thu, 27 Nov 2014 09:45:29 +0000 (01:45 -0800)]
Fix hostname validation for nameservers
Fixes the hostname validation to align with the RFC's demands[1].
This was done by replacing the full regex with a function that
broke the FQDN into individual components that were easier to
reason about with regular expressions.
Also added several test cases for domains so if someone wants
to convert it back to pure regex there will be better test vectors.
1. RFC 1123 says an all-digit hostname is allowed in section 2.1. It
says that this more liberal syntax MUST be supported.
Angus Lees [Wed, 13 Aug 2014 05:42:10 +0000 (15:42 +1000)]
Enable undefined-loop-variable pylint check
This required a trivial refactor of two existing cases in the codebase.
These two cases were perfectly correct, but the check uncovered a 3rd
case which was a real bug (fixed separately). The new versions also
make it clear that if the loop fails to break early then the 'result' is
None (and thus an error) and not simply the last element. On balance,
it's probably worth enforcing this small inconvenience to coding style.
abhishek.talwar [Wed, 19 Nov 2014 09:54:42 +0000 (15:24 +0530)]
Change description of default security group
The description for default security group in neutron
is “default”.
This confuses the end users, so updated the description
from “default” to “Default security group”.
Closes-Bug: #1291570
Angus Lees [Mon, 25 Aug 2014 02:02:16 +0000 (12:02 +1000)]
Fix incorrect exception order in _execute_request
_execute_request has a list of exception handlers to log various types
of errors with more specific error messages. Unfortunately, it catches
requests.exceptions.ConnectionError before requests.exceptions.SSLError,
but ConnectionError is a superclass of SSLError so the latter is never
invoked.
This change corrects the exception handling order, and enables the
bad-except-order pylint check now that the check passes.
Ihar Hrachyshka [Fri, 21 Nov 2014 21:01:08 +0000 (22:01 +0100)]
Migrate to oslo.i18n
Mostly trivial import changes.
- oslo.i18n no longer provide install() method to inject _() into
globals(), so removed all calls to it;
- removed Babel from dependencies (it will now be grabbed by oslo.i18n);
- updated tox.ini to ignore import violations for oslo.i18n.
gordon chung [Wed, 8 Oct 2014 21:51:47 +0000 (17:51 -0400)]
Migrate to oslo.middleware
Synced middleware module from incubator instead of removing it
completely. This is needed for grenade and to keep backwards
compatibility with existing installations with old api-paste.ini.
'log' module is updated as a dependency for middleware module.
'versionutils' are added as a new dependency for middleware module.
Russell Bryant [Sun, 23 Nov 2014 02:37:46 +0000 (02:37 +0000)]
Drop RpcProxy usage from oneconvergence plugin
This patch removes usage of the RpcProxy compatibility class from the
oneconvergence plugin. The equivalent usage of oslo.messaging APIs is
now used intead.
Ihar Hrachyshka [Fri, 21 Nov 2014 21:05:56 +0000 (22:05 +0100)]
Synced processutils and periodic_task modules
This is to avoid using gettextutils module in them to be able to drop
the module once we complete migration to oslo.i18n.
Included changes:
* openstack/common/_i18n.py: 66bad01 Allow tempest to use new log w/o oslo.i18n
* openstack/common/log.py: ac4330d Make use_syslog=True log to syslog via /dev/log df774ff Import PublishErrorsHandler from oslo.messaging a3220c5 add list_opts to all modules with configuration options
* openstack/common/periodic_task.py: a3220c5 add list_opts to all modules with configuration options 5d40e14 Remove code that moved to oslo.i18n
* openstack/common/processutils.py: 5d40e14 Remove code that moved to oslo.i18n 6ff6b4b Switch oslo-incubator to use oslo.utils and remove old modules 6a60f84 Mask passwords in exceptions and error messages 63c99a0 Mask passwords in exceptions and error messages e184dd3 Fix exception message in openstack.common.processutils.execute d6b55fb Remove `processutils` dependency on `log` 33afb20 Fix broken formatting of processutils.execute log statement 85f1784 Move nova.utils.cpu_count() to processutils module cdcc19c Mask passwords that are included in commands 2a4d15d Merge "Allow passing environment variables to execute()" 8a0f567 Remove str() from LOG.* and exceptions 51778f9 Allow passing environment variables to execute() fcf517d Update oslo log messages with translation domains af41592 Catch OSError in processutils f773ea2 Fix i18n problem in processutils module
Sylvain Afchain [Thu, 20 Nov 2014 14:25:58 +0000 (14:25 +0000)]
Fix floating-ips in error state in dvr mode
Before this fix an exception was raised when
creating the veth between the fip namespace and
the qrouter namespace when the veth was already
present.
This fix add a check to only create the veth if
not present.
Hironori Shiina [Wed, 26 Nov 2014 04:41:06 +0000 (13:41 +0900)]
Reject trailing whitespaces in IP address
Trailing whitespaces in IP address or CIDR pass API validation. These
whitespaces sometimes cause serious troubles. For instance, a trailing
CR code in allocation pools cause an ovs-agent to crash when calling
iptables. In this case, a tenant user's operation mistake affects whole
system.
By modifying _validate_no_whitespace() to reject data with whitespaces
in the beginning and the end, the IP address and CIDR validation
detects invalid attributes. The MAC address validation already rejects
these whitespaces.
Ensure that a n1kv tenant who has no access to a network profile
belonging to some other tenant, is not allowed to modify that profile.
Currently, a tenant can create networks on any network profile if he
has the network profile id.