737 Commits

Author SHA1 Message Date
Stephen Balukoff
1b992d1e12 Assign peer_port on listener creation
The introduction of shared_pools broke one of the flows for
assigning the listener peer_port. This went unnoticed for a little
while since this is presently only used in active-standby
topologies, and we don't have any scenario tests right now which
exercise active-standby regularly.

In looking to fix this flow, I realized that there's no reason we
can't assign the listener peer_port when the listener object is
created in the database. By doing this, we eliminate the need for
a couple controller worker database tasks and simplify the
listener creation flow.

This patch, therefore, updates the repository code to assign the
peer_port on listener creation, and eliminates the now redundant
controller worker database tasks and simplifies the create listener
flow.

Change-Id: I0c15dfa154c7cd57f1626945bb76c0ac0b9de071
Closes-Bug: 1547233
2016-02-23 16:40:09 -08:00
Stephen Balukoff
24ef5c9d96 Fix model update flows
The controller worker flow to update the data model was simplistically
setting new attribute values to whatever made it through the API's
verification / syntax check. While this works well for simple
attributes, if the attribute happens to be a reference to another
object, or if updating that attribute were to affect some other
attribute or linked object, this would case the data model update to fail.

The root of the issue here is that the data model code does not
currently duplicate all the functionality that is handled by SQLAlchemy
for the database models. This was complicated by the fact that we have
at the present time, essentially no tests for pure data model updates
(ie. which don't hit the underlying repository / database).

In particular, this update corrects update problems for
pool.session_persistence attributes, as well as listener.default_pool_id
attribute updates.

Closes-Bug: 1544851
Change-Id: I8617dcb38013456d5ba5e10a92e25be0c07e3e8d
2016-02-23 16:34:36 -08:00
Jenkins
e07c5c36c0 Merge "Update data model conversion to be more complete" 2016-02-23 21:39:37 +00:00
Chaozhe.Chen
2c50fd66f5 Trivial: cleanup unused conf and log variables
Basic clean up work.
In some files, oslo_config.cfg and oslo_log.log  has been imported
but not used. So remove them.

I noticed that there are a lot of unused conf variables in nova and
there is a patch to clean them up:
https://review.openstack.org/#/c/280068/
So I wondered if this was a thing in octavia as well.
Turns out it is. :- )

If have to say why not keeping them, I think it should be making
code clean and avoiding redundant compilation.

Change-Id: I59b3dcef9143db2dbaae0c9c51f4e098ddcc16e3
2016-02-22 17:00:17 +08:00
Adam Harwell
07b8c19638 Reduce devstack build time by properly using pip caches
Change-Id: Icb66f9465dd7a39e79a76e4a5454e6c168f6d8bd
2016-02-21 16:37:49 -06:00
Jenkins
521d90f823 Merge "Fix improper egress security rule deletion" 2016-02-21 09:15:52 +00:00
Jenkins
50f8393966 Merge "project_id should not be UUIDType in API validation" 2016-02-21 08:25:06 +00:00
Jenkins
b728568a1b Merge "Update flake8 exclude" 2016-02-21 02:35:28 +00:00
Chaozhe.Chen
044535c75c Remove unused paramiko
We don't need `paramiko` in our code.
So remove it from requirments.

Change-Id: I6ee1f379c17ffa7f70bd715b841e11045b2817f7
2016-02-21 01:45:33 +08:00
Chaozhe.Chen
0e0b77b4d8 Update flake8 exclude
Enable pep8 to check files in tools.
Remove the exclusion of non-existent directories.

Change-Id: I4925a36f63065077431c34d349285ad5f7fa75d4
2016-02-21 01:34:34 +08:00
Michael Johnson
cc32f27619 Fix improper egress security rule deletion
If we enable VRRP, which uses unique IP protocols 51 and 112,
the egress security group rules get mistakenly removed from
the neutron ports.
This patch fixes that issue by excluding non-TCP security rules
from the delta calculation.

Change-Id: I5c5c65224349a8f3c68a7c5a07582dcfc69f4eaa
Closes-Bug: #1547760
2016-02-20 03:01:44 +00:00
ptoohill1
c1aeec17c7 project_id should not be UUIDType in API validation
Currently UUIDType is being validted for project_id.
In most cases this will cause issues. Update to more
appropriate StringType

Change-Id: I54fa78e7140f57084fffb68528d4a4252b9a5d28
Closes-Bug: #1547717
2016-02-19 17:48:30 -06:00
Bo Wang
c31781b122 Stop using non-existent method of Mock
There is no method called_once_with() in Mock object.
Use assert_called_once_with() instead.

Change-Id: Ib41a3fb4d7b4333cb56f69244fed0bf13366453d
Closes-Bug: #1544522
2016-02-19 19:49:43 +08:00
Stephen Balukoff
92046a481f Update data model conversion to be more complete
Prior to this patch, the conversion from database model to
data model tried various recursive strategies based on object
class tracking, aimed at avoiding too many recursive back-references
to other models in the object tree in order to avoid an infinite
recursion. While this worked reasonably well, it resulted in
data model trees that would become increasingly inaccurate if
too many links were traversed away from the original object from
which the tree was generated (ie. the defacto root of the tree
that had been generated).

This problem became worse when the tree became a graph with the
introduction of the shared pools code, and the work-around for
the graph inaccuracy problem greatly increased the inefficiency
of generating the graph. (It's an O(n^2) or worse algorithm.)

This patch introduces a new strategy for generating the data model
graph based on tracking unique ID of the objects in the graph, and
making all back-references complete. By generating the graph this
way, not only do we have a complete and accurate data model graph
which should remain accurate no matter how many object links are
traversed (ie. this is a true graph and not an approximation of
a graph using a tree), but we have increased the efficiency of the
graph generation algorithm to O(n).

Partial-Bug: 1544851
Change-Id: I68c2ff0e293e3a1ea4e7b0fd38cf6d0d5cd4ec12
2016-02-18 12:55:59 -08:00
Jenkins
c1b1f6ed85 Merge "Improve test case test_upload_certificate_md5" 2016-02-18 20:03:59 +00:00
Stephen Balukoff
2e23ede4c3 Fix LB status updates
This commit updates the health monitor to update the load balancer
status even if the given load balancer (and associated amphorae) do not
have any listeners.

Change-Id: Iedfd9ebcf8e2e948c89cbc584c8fdea921b0cfbd
Closes-Bug: 1544290
2016-02-18 11:58:50 -08:00
Bo Wang
d1c41e8b45 Improve test case test_upload_certificate_md5
"handle = m()" is in code but we are not using it for any test.
add "handle.write.assert_called_once_with()" to complete this case.

Change-Id: I93d93f9013b93f326924edd0104b1e09349d5ba5
2016-02-18 17:48:16 +08:00
Stephen Balukoff
042dfd4df7 Fix amphora failover after health monitor start
The health monitor consists of two daemons: One receives heartbeats
from amphorae and updates the database, the other scans the database
for amphorae that haven't checked in in a while. If the health
monitor is down for a while, all the amphorae will seem stale in
the database once it's started again.

This patch changes the behavior of the health_check such that amphorae
have time to check in after the health monitor start before the
health monitor daemon decides they need to be failed over.

Change-Id: I0599d214c645547b3248f73f6bb3380653de0585
Closes-Bug: 1532623
2016-02-17 22:29:20 -08:00
Stephen Balukoff
ab83f5cedd Fix deleted amphora expiration check
During a normal failover, the housekeeping manager will attempt
to clean up database records having to do with the dead amphora based
on the last health check of said amphora. However, at least some of
the time, the amphora health manager would have already cleaned up
the health record, meaning that the housekeeping manager gets a
None response when it attempts to check the deleted amphora health.
This could lead to a failure in the dead amp cleanup process, possibly
gumming up failover or other tasks along the way.

This commit fixes this check such that if no health record exists
for the deleted amphora, it is assumed the amphora is expired and
all record of it can be deleted from the database.

Change-Id: Icded7127d7817d8c71a5fcb90c95775a2bf5f58c
Closes-Bug: 1544427
2016-02-17 21:35:22 -08:00
Stephen Balukoff
2a0a0944bf Delete SSH amphora driver
The old SSH amphora driver is not being used by anyone
anymore, nor is it being maintained. This patch removes it from
the Octavia code tree.

Closes-Bug: 1534218
Change-Id: I006f1c794e1ab0483886d06495ca6649f0afe479
2016-02-17 13:51:11 -08:00
Jenkins
27ca78a5de Merge "Stop logging amphora cert generation in debug" 2016-02-16 23:51:01 +00:00
Bo Wang
15fdc0ea7b Fix hacking rule of assert_equal_or_not_none
The rule is not robust enough result in error code existing.
Fix the code and the rule.

Change-Id: I68934d4931a6e7857a824d0af5ed571a9c3e6480
Closes-bug: #1280522
2016-02-16 23:14:12 +08:00
Michael Johnson
387991732e Stop logging amphora cert generation in debug
The octavia-generate-serverpem task returns the generated
certificate information for the amphora.  The default taskflow
DynamicLoggingListener would log the result of the task when
running in debug mode.
This patch tells the DynamicLoggingListener to not log the results
of the octavia-generate-serverpem task.

Change-Id: Ib846d72976dfc9cadaf6c7f0062ede764ad8a6bc
Closes-Bug: #1544785
2016-02-12 17:04:39 +00:00
Jenkins
5f3835463f Merge "Fixes an intermittent load balancer delete failure" 2016-02-12 10:52:20 +00:00
Michael Johnson
3cb4738704 Fixes an intermittent load balancer delete failure
Intermittently deleting a load balancer would lead to an
PortNotFoundClient exception that would make DeallocateVip
revert.  This patch fixes an except statement that was catching
the wrong exception.

Change-Id: Ia752ee7a1be339533e478d1646ad215e1c7507d4
Closes-Bug: #1544375
2016-02-11 15:54:45 +00:00
Jenkins
55b63fc047 Merge "Octavia: API docs Entity Status Fix" 2016-02-11 02:21:12 +00:00
Jenkins
37f543aa94 Merge "Assign load_balancer in _port_to_vip()" 2016-02-11 00:03:26 +00:00
Franklin Naval
460db136c4 Octavia: API docs Entity Status Fix
* entity statuses were reversed
* added new operating status: NO_MONITOR

Closes-Bug: #1544310

Change-Id: I42f6db569dc266c60dac4a666df053ca3016f555
2016-02-10 16:09:00 -06:00
ptoohill1
025ec0024b Allow user-data on amphora creation
Currently, Amphora configuration data is being sent as personality
files as considered by Nova and some providers have limitations
and must use cloud-init user-data.

This patch introduces a new config option to enable user-data.
If enabled the files that were built, such as the amphora config
and certificates for the agent, will be templated into a cloud-init
user-data script that loads the files as expected. After this we
need to restart the agent as cloud-init happens at a higher level
than service scripts. This does increase the boot time.

This is configurable so there is no impact if it's not needed.

Change-Id: I60fa87722302eee9d3d1fd6ff1b5b5b697a2406e
Closes-Bug: #1541231
2016-02-09 16:34:16 -06:00
Jenkins
ca8c263a3d Merge "Reverts a workaround that is impacting amp updates" 2016-02-09 08:19:54 +00:00
Jenkins
e8aa9c5667 Merge "Do not use __builtin__ in python3" 2016-02-09 07:26:40 +00:00
Jenkins
16719f4400 Merge "Adding "region and endpoint_type" parameters to barbican_acl.py" 2016-02-09 00:35:06 +00:00
Jenkins
76f490db66 Merge "Revert "Fix for ssl context wrapper spam", add warning filter" 2016-02-08 23:53:49 +00:00
Jenkins
803bdfc6f0 Merge "Adds a parameter to specify endpoint type" 2016-02-08 23:03:30 +00:00
Michael Johnson
419319103a Reverts a workaround that is impacting amp updates
This patch removes a workaround database call that causes old
data to be pushed to the amphora haproxy configuration.

Change-Id: I7199a744700e446c1481b1b46d274b8a763730d6
Closes-Bug: #1542120
2016-02-08 23:00:24 +00:00
Jenkins
9fe6b1282f Merge "Fix / and /v1 API uris" 2016-02-08 22:25:33 +00:00
Aishwarya Thangappa
c887461f61 Adding "region and endpoint_type" parameters to barbican_acl.py
When requesting for a barbican client, this change lets you filter based on
region and endpoint_type.

Conflicts:
	etc/octavia.conf

Change-Id: Ib4b9b75027443177c039f60f99822b9b3d021b8a
2016-02-08 13:53:18 -08:00
Jenkins
18151112c1 Merge "Fixes Octavia Amphora RHEL based images" 2016-02-08 21:52:08 +00:00
Shuquan Huang
6e51606b56 Do not use __builtin__ in python3
__builtin__ does not exist in Python 3, use
six.moves.builtins instead.

Change-Id: I58d456669abcbc58c9a3df8f15f24996a71b299b
closes-bug: #1290234
2016-02-08 15:21:20 -06:00
Jenkins
3b34e08516 Merge "Use netifaces constants correctly in testing" 2016-02-08 21:12:47 +00:00
German Eichberger
22097dc88f Adds a parameter to specify endpoint type
When getting a service catalog from keystone there might be
multiple endpoint types. Adds new parameters to specify
the endpoint type to use in each of the new neutron/nova
groups.

Nova config attributes are removed as the endpoint would be retrieved
from the service catalog with respective endpoint_type and corresponding
roles would define nova access.

CONFIG is added as needed and cfg being removed.

Change-Id: Ie01bd6967eb2003dbe4f7a11ffe8e20a16aa83f5
2016-02-08 12:45:55 -08:00
Brandon Logan
c7d8f12f10 Fix / and /v1 API uris
An update in the past added @staticmethod decorators to everything that didn't
use self in the function body.  Thise broke the way pecan calls the API
methods because pecan calls each method independent of the instance.  Pecan
instead passes the instance as the first argument.  With staticmethod not
having this first argument, it broke.

Change-Id: I19e30ecae3c1d49e569950b2675a73b2fbc1f942
2016-02-08 14:16:20 -06:00
Adam Harwell
12828aa8f0 Use netifaces constants correctly in testing
Closes-Bug: 1543248
Change-Id: I01fb17c7937c9ed4ab5ab98f747f2032e74a2322
2016-02-08 12:52:36 -06:00
Adam Harwell
0e78993002 Remove dead code around certificate handling
LocalCertManager is unusable because there's no way to get cert data
into the system (the API doesn't accept it) so there's no way we could
store it, which makes it unusable for its original purpose which was to
be a dev tool (it is not suitable for production use in any case).

Barbican does not support certificate generation in a way that makes
sense for us (they do async only) and Anchor will be the way forward.
This driver will never be completed and therefore should be removed.

Change-Id: I78019bc7ad7dffc745055216ed2aace725c58de2
2016-02-08 12:43:57 -06:00
Adam Harwell
cc48f6e6a3 Revert "Fix for ssl context wrapper spam", add warning filter
Original fix merged before global-requirements were updated, because
requirements weren't being checked accurately. It now looks like
ndg-httpsclient will not be added to global-requirements, and the
warning in question doesn't affect us, so roll back the original fix and
simply squelch the warning.

Global-requirements checks are temporarily disabled on our project until
we fix our requirements to match, so we should get this done ASAP.

This reverts commit 2c2be96a10d94ba4fcc48a96e04589d3ec273b97.

Change-Id: I8e77624fa9558f0596938c16fe4c5a880d56316c
2016-02-08 11:33:33 -06:00
Jenkins
25bcbc1cc1 Merge "Add endpoint override conf option for neutron and nova" 2016-02-06 09:52:58 +00:00
Jenkins
ab30b96d54 Merge "Fixes Octavia flows that are not reverting" 2016-02-06 01:39:24 +00:00
Jenkins
38f613b55c Merge "Shared pools support" 2016-02-06 00:29:33 +00:00
Michael Johnson
02528f5fa9 Fixes Octavia flows that are not reverting
Some of the revert methods on tasks inside Octavia are missing
required parameters.  This causes the revert to fail.
This patch corrects those revert methods.

Closes-Bug: #1527428

Change-Id: I2accbe55db710a312d31be5f3da8e06b7ab79025
2016-02-05 23:07:39 +00:00
Brandon Logan
4a460b3b45 Remove out-dated README file
This README was created at the inception of Octavia when it was thought we
may have to import neutron directly.  This is not the case and I believe we
shouldn't accept it even is needed.  We should add to neutron's API if we need
a functionality exposed.

Change-Id: I5bc708247021f291f43f2c127806927ff99f4774
2016-02-05 13:18:05 -06:00