sridhargaddam [Mon, 22 Jun 2015 14:13:56 +0000 (14:13 +0000)]
Fix ip_lib get_gateway for default gateway on an iface
Currently get_gateway() of IpRouteCommand class always assumes
the presence of gateway_ip when default_route is seen.
Since we can also have interface routes without the gw_ip,
this patch fixes the issue by parsing the output accordingly.
Henry Gessau [Sun, 21 Jun 2015 05:30:05 +0000 (01:30 -0400)]
Allow setting Agents description to None
Fix the validator for the 'description' attribute of Agents, allowing
it to be set to None.
Fix an API test that had two problems:
1. It was not restoring the description to the agent it had updated
2. It was retoring the description to '' instead of None.
Gal Sagie [Mon, 25 May 2015 12:20:05 +0000 (15:20 +0300)]
Decompose DVR CSNAT L3 Agent from Compute Node L3 Agent
Currently the same dvr router class is used both by the L3 Agent
in the compute nodes that is responsible for the virtual routers
namespace and the fip namespace and also used by the centralized
SNAT L3 Agent in the network node.
This is the first step to decompose the two into different
classes.
The above means that we have one class of DVR router which is used
for two jobs (the virtual router namespace wiring and the fips wiring
in the compute node in one hand and the centralized snat wiring in the other)
The end goal of this patch is to separate the two into different classes
which will also help maintaining it and also help projects that want
to use one but not the other (for example only use the centralized
SNAT behaviour with there own DVR implementation)
Jakub Libosvar [Fri, 19 Jun 2015 13:52:35 +0000 (15:52 +0200)]
Disable keepalived process in keepalived func test
Previously, keepalived process itself was disabled that lead to
respawning of keepalived by KeepalivedManager. This patch disables
KeepalivedManager in cleanup thus no respawn happens.
Pavel Bondar [Wed, 17 Jun 2015 12:48:09 +0000 (15:48 +0300)]
Add request factory for pluggable IPAM
Pluggable IPAM implementation requires separation between requesting
address/subnet and it's actual allocation, which can happen on
third-party IPAM servers. Request factory stands for simplifying
building right request from input.
Added AddressRequestFactory and SubnetRequestFactory.
AddressRequestFactory creates instance of AnyAddressRequest or
SpecificAddressRequest depending on presence of ip address in input.
SubnetRequestFactory creates instance of AnySubnetRequest or
SpecificSubnetRequest depending on input.
get_subnet_request_factory and get_address_request_factory can be
redefined on driver level to use custom request factories.
In Nova flavors it is ok to specify a decimal RXTX factor.
For this reason when applying QoS to a port Neutron should not
convert this factor to an integer value, but simply ensure
it's a valid float number and positive.
Pavel Bondar [Thu, 18 Jun 2015 11:17:58 +0000 (14:17 +0300)]
Move _add_auto_addrs_on_network_ports
Moved to ipam_non_pluggable_backend.py since implementation
is specific for non pluggable ipam backend.
Pluggable implementation will additionally include rollback on failure actions.
This commit is a preparation step for using pluggable ipam.
More changes in this methods are expected to be done by following
patches.
Ironic expects neutron to have an "ipxe" tag for the option 175 which is
sent by iPXE/gPXE when booting a node. The problem is that up to now this
tag was not created by Neutron, causing the nodes deployed with Ironic
+ iPXE to fail to boot. This patch is creating this tag when launching
the dnsmasq process.
Pavel Bondar [Wed, 17 Jun 2015 15:47:11 +0000 (18:47 +0300)]
Remove _check_ip_in_allocation_pool
_check_ip_in_allocation_pool is not used anywhere in neutron.
Cleaning up unused code from db_base_plugin_v2.py.
Caller was removed over a year ago in change
Ib31550fa9000fc75768a327cb6cc1c419e06568f
Error when _read_hosts_file_leases tries to parse stateless IPv6 entry
in hosts file
TRACE neutron.agent.dhcp.agent ip = host[2].strip('[]')
TRACE neutron.agent.dhcp.agent IndexError: list index out of range
Neutron creates entries in dhcp host file for each subnet of a port.
Each of these entries will have same mac address as first field,
and may have client_id, fqdn, ipv4/ipv6 address for dhcp/dhcpv6 stateful,
or tag as other fields.
For dhcpv6 stateless subnet with extra_dhcp_opts,
host file will have only mac address and tag. So _read_hosts_file_leases
shouldn't check for ip address for this entry in host file.
shihanzhang [Fri, 30 Jan 2015 01:50:52 +0000 (09:50 +0800)]
Fix 'router_gateway' port status can't be updated
when it creates a ovs bridge without parameter 'bridge-id',
it's default 'bridge-id' is None, so ovs agent should also
deal with these ovs bridges, for example if ancillary bridge
br-ex does not be handled, the 'router_gateway' port status
can't be updated.
Doug Hellmann [Tue, 16 Jun 2015 19:49:15 +0000 (19:49 +0000)]
Update version for Liberty
Update the version for Liberty, switching from date-based versioning
to pre-versioning using SemVer. See
http://lists.openstack.org/pipermail/openstack-dev/2015-May/065211.html
and
http://lists.openstack.org/pipermail/openstack-dev/2015-June/067082.html
for details.
Cyril Roelandt [Wed, 17 Jun 2015 14:25:56 +0000 (14:25 +0000)]
Python 3: do not use cmp(), nor sorted(..., cmp=...)
* The "cmp" function has been removed, so we must not use it any more;
* The "cmp" keyword argument of the "sorted" function has been removed, so
replace it with "key=functool.cmp_to_key".
Some database engines require exact match of sizes of foreign keys
and referenced fields. Foreign key ipsec_site_conn_id of table
cisco_csr_identifier_map is varchar(64) but it references field
id varchar(36) of table ipsec_site_connections. This gives error
while running migration scripts in such databases.
This fix only applies to new installations. Existing databases will
be corrected by migration scripts introduced in
https://review.openstack.org/190569 - they will take care of resizing
the field and adjusting the model.
Aaron Rosen [Wed, 17 Jun 2015 00:23:09 +0000 (17:23 -0700)]
ovsdb: session.rpc never initialized
Previously, if idl.Transaction.commit_block() returned a status of
TRY_AGAIN we would check self.api.idl._session.rpc.status which would
result in an attribute error as rpc is None.
This patch fixes this attribute error by removing this unneeded check. In
addtion, the force_reconnect() is also removed as ovs.jsonrpc handles
reconnecting automatically for us.
Rawlin Peters [Mon, 15 Jun 2015 16:57:02 +0000 (10:57 -0600)]
Remove duplicated debug logging around locking
Currently, iptables_manager.py does extra unnecessary logging about lock
acquisition and release. It uses lockutils.lock() which passes
do_log=True by default, which causes lockutils.lock() to do debug
logging about lock acquisition/release. IptablesManager itself also writes
debug log info about lock acquisition and release.
This change will eliminate unnecessary duplicate logging in order to
reduce log noise about locking. This change is also related to
https://github.com/harlowja/fasteners/commit/f88f2fea7fe250b7d26cdcbc84633ccbbc68eeee
which reduces the logging level in the underlying lock implementation
used by oslo.concurrency. That change along with this one will remove
the duplicate debug logging about locking in iptables_manager.py and also in
ipset_manager.py.
Aman Kumar [Tue, 16 Jun 2015 12:32:44 +0000 (05:32 -0700)]
Refactor scan_ports() and update_ancillary_ports() in OVS Neutron Agent
Used a helper method which contains the common code from scan_ports()
and update_ancillary_ports(). And also renamed the name of
update_ancillary_ports() method to scan_ancillary_ports() to have parity
between normal ports and ancillary ports.
Havana was deprecated with the kilo release, and icehouse will be
deprecated with the liberty release, so havana_inital migration should be
removed and replaced with juno_initial.
Ihar Hrachyshka [Tue, 16 Jun 2015 07:21:42 +0000 (09:21 +0200)]
docs: added job to well known tox envlist
This is to make 'tox -l' return the job name in its output (needed to
allow run-docs.sh script in project-config to determine whether the job
is present, to rely on it when generating docs in gate).
Pavel Bondar [Wed, 10 Jun 2015 13:18:40 +0000 (16:18 +0300)]
Refactor update_port in db_base_plugin_v2
This commit is a preparation step for using pluggable IPAM.
- moved validations into _validate_port_for_update;
- updating ip addresses for port is backend specific, so
moved into _update_port_with_ips in ipam_non_pluggable_backend;
- writing port changes to db is common for both backends, so
moved into _update_db_port in ipam_backend_mixin;
- updated to use namedtuple to track add/original/remove ips;
- added _make_fixed_ip_dict to exclude keys other than
ip_address and subnet_id;
Pavel Bondar [Wed, 10 Jun 2015 11:56:58 +0000 (14:56 +0300)]
Refactor _update_ips_for_port
This commit is a preparation step for using pluggable IPAM.
_update_ips_for_port was refactored and split into two methods:
- _get_changed_ips_for_port
This method contains calculations common for pluggable and
non-pluggable IPAM implementation, was moved to ipam_backend_mixin.
- _update_ips_for_port
This method is specific for non-pluggable IPAM implementation, so it
was moved to ipam_non_pluggable_backend_common.
Other changes:
- _update_ips_for_port now returns namedtuple with added, removed, original
ips (previously added and original ips were returned).
List of removed ips is required by pluggable IPAM implementaion
to apply rollback-on-failure logic;
- removed unused port_id argument from _update_ips_for_port argument list;
Cedric Brandily [Tue, 9 Jun 2015 16:00:58 +0000 (16:00 +0000)]
Ensure no "db" related functional/fullstack tests are skipped in the gate
Currently neutron uses MySQLTestCase[1] and
PostgreSQLOpportunisticTestCase[2] for functional and fullstack tests
using a real MySQL/PostgreSQL database. These classes skip tests when
the db is unavailable (db not installed/configured, missing packages,
etc.) which is fine when tests are runned by developers but not when
runned by the gate jobs.
This change updates MySQLTestCase[1] and defines PostgreSQLTestCase[1]
as PostgreSQL oslo.db test class wrapper: when the db is unavailable,
these classes ensure tests will:
* fail in the gate (dsvm-functional, dsvm-fullstack jobs),
* be skipped by default otherwise (functional, fullstack jobs).
Cedric Brandily [Wed, 10 Jun 2015 20:35:11 +0000 (22:35 +0200)]
Use PyMySQL in MySQL related functional/fullstack tests
mysql-python driver has been replaced by PyMySQL driver[1] in neutron
code but MySQL related functional/fullstack tests try to use
mysql-python driver because of MySQLOpportunisticTestCase[2] and tests
are skipped because mysql-python driver is no more available.
This change provides a backend implementation for mysql+pymysql, a base
base testcase MySQLTestCase[2] using mysql+pymysql implementation
(currently oslo.db provides none of them but will in the future) and
replaces MySQLOpportunisticTestCase with MySQLTestCase.
Skip rescheduling networks if no DHCP agents available
This eliminates the problem of unscheduled networks in case
of communication failure between agents and servers which
can occur if messaging queue service fails.
Russell Bryant [Sat, 13 Jun 2015 01:26:37 +0000 (21:26 -0400)]
Reflect project moves from stackforge to openstack.
Several git repos were just moved from stackforge to openstack.
Reflect the move in various places where the URL was in docs and
comments. In passing, also change URLs to git.openstack.org instead
of github, as that is the official home of all of these repos.
Pavel Bondar [Mon, 8 Jun 2015 11:15:30 +0000 (14:15 +0300)]
Decompose db_base_plugin_v2.py with changes
This commit is a preparation step for using pluggable IPAM.
1. Moved get_subnets functionality to db_base_plugin_common to make it
accessible by ipam backends.
2. Reworked update_subnet routine:
- moved db part into update_db_subnet;