Commit Graph

230 Commits

Author SHA1 Message Date
Edwin Zhai
278b1819d6 Use install instead of mkdir for DevStack dirs
The current code will not work if WATCHER_CONF_DIR or
WATCHER_AUTH_CACHE_DIR already exist but are owned by a different user
such as root. Use install instead of mkdir to handle this scenario.

Change-Id: Ie582a4b393e898e007d73f31de490c4b77e40be3
Closes-Bug: #1539422
2016-02-02 09:53:55 +00:00
Vincent Françoise
de307e536e GET on an action_plan provides first_action_uuid
Whenever trying to get the first action related to a given action
plan, we were getting back a 'null' value from the API even though
we knew there were actions to be linked to it in the DB.
So I fixed this issue and added a related unit test.

Change-Id: I1fa755f24fbf37ecd6ce2cc2396658fca8743a1c
Closes-Bug: #1538130
2016-01-27 09:38:15 +01:00
Vincent Françoise
7406a1e713 Fixed ActionPlanNotFound typo in msg_fmt
The msg_fmt of ActionPlanNotFound was missing an "_" which caused
errors upon trying to format it, so I fixed it.

Change-Id: I515c2097a563f809e319d2e57480fd340b878cef
Closes-Bug: #1538065
2016-01-26 11:32:09 +01:00
Vincent Françoise
982410dd3e Fixed tempest test bug
has_audit_succeeded was not implemented so I added it back.

Change-Id: Ic567ff56ea6d513c32fbe7ad08cca96b5dfb15e8
Closes-Bug: #1537144
0.23.1
2016-01-26 09:17:39 +01:00
Vincent Françoise
83fdbf7366 Action plan state transition - payload validation
This patchset fixes the lack of field validation that are provided
by an API user.

Via a PATCH on /action_plans, the only field that can be modified
is now the 'state'. This field can only perform to the following
state transitions:

- RECOMMENDED --> TRIGGERED
- RECOMMENDED --> CANCELLED
- ONGOING --> CANCELLED
- TRIGGERED --> CANCELLED

The DELETED state can only be set using a DELETE request.

Closes-Bug: #1531106
Change-Id: I6669cbe63407f0bbb792fb2e2ce6b1e8a7365238
0.23.0
2016-01-25 17:37:59 +00:00
Jenkins
2db5ae31c7 Merge "API Tempest tests on goals" 2016-01-25 16:59:13 +00:00
Jenkins
2191844ebb Merge "Add 'workers' section into configuration doc" 2016-01-25 16:27:48 +00:00
David TARDIVEL
9c71b3df88 Add 'workers' section into configuration doc
Workers has been introduced into Decision Engine and Applier.
We can now tune ithe number of workers (threads) used by the
Decision Engine and the Applier services, by updating the Watcher
configuration file.

Change-Id: I81523666e4373e7b1dd59b36daf19067fd61b48f
Closes-Bug: #1528132
2016-01-25 16:17:21 +00:00
Jenkins
7beb9b4c29 Merge "Fix HTML warnings on HTML doc" 2016-01-25 16:04:23 +00:00
Vincent Françoise
8b7dce4803 API Tempest tests on goals
This patchset adds CRUD tests on goals via the API.

Partially Implements: blueprint tempest-basic-set-up

Change-Id: Ief544e738d4530bcf981824803de059ae554a059
2016-01-25 16:51:02 +01:00
Jenkins
94c50825e4 Merge "Added doc8" 2016-01-25 15:18:34 +00:00
David TARDIVEL
6ff4ba991e Fix HTML warnings on HTML doc
Some cros-references were broken. This pathset fixes them.

Change-Id: Iddd5df6cffb85258582c5571ce541a27467bea35
Closes-Bug: #1522034
2016-01-25 11:23:28 +01:00
Jenkins
9e5a3708e1 Merge "Action Plan state - Changed STARTING to TRIGGERED" 2016-01-22 16:52:03 +00:00
Jenkins
ca5ae03b81 Merge "Tempest scenario - execute a dummy strategy" 2016-01-22 16:51:22 +00:00
Jenkins
b47aefac30 Merge "API Tempest tests on Action plans" 2016-01-22 16:49:27 +00:00
Jenkins
70c7e1c639 Merge "Add reference to Ceilometer developer guide" 2016-01-22 16:48:26 +00:00
Jenkins
ef78e68022 Merge "Re-organize the Wacher documentation Home Page" 2016-01-22 15:20:22 +00:00
Vincent Françoise
4dfe6a3fa8 Action Plan state - Changed STARTING to TRIGGERED
As the STARTING state was not clear on its meaning, I renamed it
to TRIGGERED.

Change-Id: I99cceeb57f3d7d42c1543b21fad88a6872bc4e55
Closes-Bug: #1533245
2016-01-22 15:19:04 +00:00
Vincent Françoise
b53da21b9b Tempest scenario - execute a dummy strategy
This patchset implements the first scenario for Watcher which does
the following actions:

- create an audit template with the dummy strategy
- run the audit to create an action plan
- get the action plan
- run the action plan
- get results and make sure it succeeded

Partially Implements: blueprint tempest-basic-set-up

Change-Id: Iee74ede0bd1bcd03e8938f2ec8c6884f99e7f99a
2016-01-22 15:18:44 +00:00
Vincent Françoise
4305935312 Added doc8
For a better doc QoS, we now use doc8 as part of the testing
procedure while removing the existing tests we had on doc formatting.

I also updated tox.ini to run doc8 as within 'pep8' and 'docs' venvs.

Change-Id: Ia0ad99541509f4c026e26d28c41ff0210b12a504
Closes-Bug: #1524228
2016-01-22 15:56:47 +01:00
David TARDIVEL
894dfa0d7e Add reference to Ceilometer developer guide
Strategies can require, from Watcher, metrics collected on the IAAS.
Watcher uses only Ceilometer API to retrieve metrics.
Change the metrics database backend, add a new metric is not in
the scope of Watcher, but rather in the Ceilometer one. We add some
links to Ceilometer documentation about these topics.

Change-Id: If37c7df8e5852f5ecf94b4a9eb9c8c91fe6637eb
2016-01-22 14:53:40 +00:00
Vincent Françoise
a16351d352 API Tempest tests on Action plans
This patchset adds CRUD tests on Action Plans via the API.

Partially Implements: blueprint tempest-basic-set-up

Change-Id: I8ff3c3f0dbf7d301be2e3f401edf24bca44914bd
2016-01-22 15:18:15 +01:00
Jenkins
75772cd3db Merge "Fix 'Module index' broken HTTP link" 2016-01-22 14:04:59 +00:00
David TARDIVEL
63d9500904 Re-organize the Wacher documentation Home Page
Change the title of the page.
Create a 'Getting Started' section.
Create a 'Plugins' section.
Add links to related source code repositories.
Fix bad link to watcher client installation doc.

Change-Id: Ie0548149751d53b5fca235da69798dd0d333b14c
Partial-Bug: #1535244
2016-01-22 14:19:41 +01:00
David TARDIVEL
c8096c6148 Fix 'Module index' broken HTTP link
'Module Index' link points to HTML doc generated from source/api
RST files. These RST files are generated by pbr, by setting the
parameter 'autodoc_index_modules' to True.

Partial-Bug: #1535244
Change-Id: Ifceb5a140599d3968ea3d353b12c0bbe99d955e6
2016-01-22 12:58:53 +01:00
Vincent Françoise
6d0754bb65 API Tempest tests on Audits
This patchset adds CRUD tests on Audits via the API.
Many of them are currently skipped as they revealed some underlying
bugs which are referenced on launchpad.

Partially Implements: blueprint tempest-basic-set-up
Change-Id: I5769f601f9d1cb94bb541959f94f0fa2e17d15c9
2016-01-22 11:37:26 +01:00
Vincent Françoise
595b13a622 Refactored existing tempest API tests
We must set up Tempest for Watcher
(http://docs.openstack.org/developer/tempest/configuration.html)
to run integration tests inside devstack environment.

This patchset is a refactoring of the stale Tempest tests to now
use the latest Tempest coding standards (like using plugins and
credentials factory).

This commit will have an effect on the doc as we need to integrate
Tempest in the Watcher documentation.

DocImpact
Partially Implements: blueprint tempest-basic-set-up
Change-Id: I7600ff8a28d524b56c7dd4903ac4d203634ae412
2016-01-22 09:53:33 +00:00
Jenkins
8832ad78e2 Merge "Refactor Commands section" 2016-01-22 09:47:51 +00:00
Jenkins
be81f8aff2 Merge "Renamed Status to State" 2016-01-22 09:45:10 +00:00
Jenkins
e95548b1a9 Merge "Update the user-guide to explain the main steps" 2016-01-22 09:41:27 +00:00
Vincent Françoise
62b39fefbb Renamed Status to State
As we can see in the codebase, we have 3 "Status" enums which are
located at:

- watcher/objects/action.py
- watcher/objects/action_plan.py
- watcher/objects/audit.py

So I renamed them from "Status" to "State" to be consistent with
the DB schema.

Change-Id: If3d180c9daba6ae9083775ad6813aa4c21763dbf
Closes-Bug: #1522733
2016-01-22 09:36:21 +01:00
vmahe
f23548b92f Update the user-guide to explain the main steps
Added a new sequence diagram to explain showing the main steps
regarding Watcher usage:
- create a new audit template
- launch an audit and receive a recommended action plan
- launch the action plan

Change-Id: I1a0031b957d34908020be06870ed1d2772cd5af6
Closes-Bug: 1536731
2016-01-22 09:16:47 +01:00
Jenkins
43275537ea Merge "Removed unused parameters from api controllers" 2016-01-22 07:52:10 +00:00
David TARDIVEL
eaed650000 Refactor Commands section
Rename this section to 'Watcher Manual Pages' and add man RST
files.

Partial-Bug: #1535244
Change-Id: I1c890c8d053238aa568075d844f97b1e4289adcb
2016-01-21 19:46:04 +01:00
Jenkins
0505466ea5 Merge "Use taskflow library for building and executing action plans" 2016-01-21 17:38:14 +00:00
Jean-Emile DARTOIS
0e7bfe61bd Use taskflow library for building and executing action plans
The aim of this patchset is to integrate taskflow in
the Watcher Applier. Taskflow will help us a lot to make
Action Plan execution easy, consistent, scalable and reliable.

DocImpact

Partially implements: blueprint use-taskflow

Change-Id: I903d6509d74a61ad64e1506b8a7156e6e91abcfb
Closes-Bug: #1535326
Closes-Bug: #1531912
2016-01-21 18:13:42 +01:00
Jenkins
096354c255 Merge "Add diagrams to the architecture doc page" 2016-01-21 17:06:11 +00:00
Jenkins
afe06e2349 Merge "Reduced the complexity of the execute() method" 2016-01-21 17:05:05 +00:00
Jenkins
1d689ef410 Merge "Validate audit template UUID on audit create" 2016-01-21 16:55:20 +00:00
Gábor Antal
58fb86a3da Removed unused parameters from api controllers
In the Audit controller (watcher/api/controllers/v1/audit.py),
we have an unused "audit_uuid" parameter in both get_all()
and detail()

Similarly, the Action Plan controller
(watcher/api/controllers/v1/action_plan.py) has an unused
"action_plan_uuid" parameter in both get_all() and detail().

I also removed them from the @wsme_pecan.wsexpose decorator

Change-Id: I7f1edfd44dd95c9768249650e19b16fcbe916b89
Closes-Bug: #1534615
2016-01-21 13:55:18 +01:00
Jenkins
f675003076 Merge "Remove shadow BaseException class" 2016-01-21 08:10:55 +00:00
Taylor Peoples
e34ee792a8 Validate audit template UUID on audit create
The audit template UUID should be validated during the creation of an
audit.  An HTTP 400 error is returned to the client if an invalid audit
template UUID is passed as part of the body when creating an audit.

APIImpact
Closes-Bug: #1510188

Change-Id: I0543d22751b77f6641ddef6a7f0f4acce61180fd
2016-01-21 08:43:28 +01:00
Jenkins
037f43cd04 Merge "Missing super() in API collection controllers" 2016-01-20 14:14:08 +00:00
vmahe
8f87699910 Add diagrams to the architecture doc page
Added some data model diagrams, sequence diagrams and state machine
diagrams.
The state machine diagrams and sequence diagrams are built with
PlantUML whereas data model diagrams are built with Dia.
Also added some textual description with the sequence diagrams.

Change-Id: Iffbb47b0f2d12ce63eeaa1531a1bd1a790d69e79
Closes-Bug: #1531802
2016-01-20 07:23:03 +01:00
David TARDIVEL
c811051351 Fix Warnings generated while building of HTML docu
Same ID have been set to reference different RST blocks.
To avoid this, I added the prefix 'archi_' within ID referencing
architecture RST block.

Bad indentation warnings have been fixed.

Change-Id: I17f43f2f564ffd83fd5c345aed96fad06ee56b1d
Partial-Bug: #1522034
2016-01-20 00:58:09 +01:00
Béla Vancsics
a2750c74f9 Reduced the complexity of the execute() method
The execute() method is very large - almost 150 lines,
and McCabe's cyclomatic complexity 22.
(watcher/decision_engine/strategy/strategies/basic_consolidation.py)
I extracted some of the functionalities into helper functions
to reduce the length and complexity of execute().
http://openqa.sed.hu/dashboard/index/544838?did=1
Additionally it became more readable as well, without
changing its functionality.

Change-Id: I760929f56e258b87d7f1d4586bcc90665f1e0d8f
Closes-Bug: 1535729
2016-01-19 18:37:11 +01:00
Gábor Antal
67455c6a84 Missing super() in API collection controllers
The __init__ of these 3 classes are missing the super() call

watcher/watcher/api/controllers/v1/goal.py:113
watcher/api/controllers/v1/audit.py:217
watcher/watcher/api/controllers/v1/audit_template.py:166

Change-Id: I2fec1d5dac29a311f617ef141d5bf91f00b96219
Closes-Bug: #1535354
2016-01-19 13:15:32 +01:00
Taylor Peoples
a7455a8bf7 Remove shadow BaseException class
The BaseException class defined in exceptions.py is shadowing the
built-in BaseException class of the Python exception hierarchy, which
could potentially cause confusion.

This removes the BaseException definition and replaces it with the
existing WatcherException object.  Instantiations of the
IllegalArgumentException are also changed to use the message kwarg.

Change-Id: I20abf135805c7a354924de8a5194b59fc040460a
Closes-Bug: #1535504
2016-01-19 06:59:54 +01:00
Taylor Peoples
7fcb683404 Replace message with msg_fmt for custom exceptions
The custom exceptions were defining the message format string as the
'message' attribute, which was confusing as 'message' is also being used
as an input argument to the class.  This combined with the fact that the
the 'message' attribute of Python's BaseException has been deprecated,
msg_fmt replaces message to hold the message format of the exception.

The root cause of the bug in question was caused by the __unicode__
method returning self.message, which did not have the kwargs substituted
into the actual message format.  The fix is to use self.args[0] instead,
which will contain the message format with the kwargs substituted in
since that is passed to the super's (Exception) __init__ method.  See
PEP 0352 for more information on how Exception and BaseException work.

The _cleanse_dict method is also removed as it is not used anywhere.

Change-Id: Ie8ac96afaecc732693a184d0e06e77c56ca8eeb9
Closes-Bug: #1535473
2016-01-19 04:20:37 +01:00
Jenkins
65cf19a7e4 Merge "Removed use of deprecated LOG.warn method" 2016-01-18 17:08:58 +00:00