Classes in parser.py are already split to stack.py and
template.py, it's not recommended to import it.
Closes-Bug: #1442011
Change-Id: Ia8cc0ca07e7926fe8b7d9f5c89b39053a799e689
Fix the HeatTestCase import issue as required by H302,
a following patch of https://review.openstack.org/#/c/129846/
Change-Id: Iab9a508682e9fe2932b7d00b191c8a4cdea4738b
Instead of rising an exception, boolean and integer values are
converted into string if string is expected.
Change-Id: I1e0014576c4df447bfa1595c530f1e24f411195d
Closes-Bug: #1367375
Stop creating Resources with dicts that are snippets of templates, and
instead always use ResourceDefinition objects to create Resources.
Change-Id: I1587f1edf9b04f06bd435857d7c1ea2c1cc26058
There are a lot of places in unittests where defined template
does not contain template version. This section should be added
everywhere. At this moment if template has not version field,
exception should be raised.
Closes-Bug: #1289487
Change-Id: I422b1468bfd57880fda0dac15ad53932fce7a447
Move the setup/reset of the dummy DB into the test common base-class,
which ensures the setup/recent happens consistently (some tests setup
but then don't reset for example), and ensures there's always a clean
dummy DB per test.
Change-Id: I8e3bdd23399cb0d1d3c93daae66e6509b12b4e72
This patch is one in a series to re-enable H306 style check rule
(imports are in alphabetical order). It touches roughly half of tests
(up to and including test_m*).
Implements: blueprint reduce-flake8-ignored-rules (partial)
Change-Id: Id1e10f7a519ceeb4339488760b36950440461edb
Re added the autoincremental id column for the Event table, and added a
new column to store the event uuid. The uuid will be exposed to the user
as the id of the event, but internally the event will be handled using
the value of the id column.
Change-Id: I43464c6079bf7631fda0c4ab112b8f874c6190a3
Co-Authored-By: chmouel@enovance.com
Closes-Bug: #1261883
Many plases in tests code use assertEqual(AA, None),
the same with True and False and negatives of such comparisons.
As comparison to singletons must use `is` operator, appropriate usage
is assertIs, assertIsNot, assertIsNone, assertIsNotNone
These assertions are provided by the `testtools` package,
so this change is not breaking backward compatibility with Python 2.6
This first patch inlcudes roughly half of the files touched by these changes
(up to and including test_n* sans `contrib` code) to ease the review.
Partial-Bug: #1259023
Change-Id: If6779c9230cf73ab93165a00040d1ca32d087c80
The code in tests was using assertTrue(A in B) and similar
instead of assertIn / assertNotIn.
assertIn / assertNotIn assertions are provided by `testtools` package,
so this change is not breaking backward compatibility with Python 2.6.
Closes-Bug: #1259295
Change-Id: Ibf3b0c7f27895699db8a13bf6e1640d196f1a953
Previously users could write to the events table infinitely. With this
change Heat will automatically prune some events if the maximum is
reached. The behavior can be disabled by setting max_events_per_stack to
zero.
Change-Id: I4fb2fefbd9bcd10ce1767ddf58a870206a6482a1
Fixes-Bug: #1209492
This is to address an unimplemented comment at
https://review.openstack.org/#/c/41290/2/heat/engine/event.py
Bascically, there is a logical_resource_id/resource_name mismatch to
address, and this patch is trying to resolve that.
Change-Id: Idac696259af30f8db7816499474057c354d73800
The event table is pretty much self contained. So we actually don't
need to referece the corresponding resources to retrieve information.
Fixes bug #1204506
Change-Id: If0b88e0f9e243cf3cc6d747ffa04b9a429ea83a2
list_events constructs Event objects through Event.load, which causes
every event record previously loaded into memory to be reloaded again.
Furthermore, Event.load will also reload the associated stack, thus
all its resources and template. Another bad thing with that is
reloading a stack will lead to many extra stack static resolution
(including calls to nova to resovle Fn::GetAZs if it's referenced in
the template).
Fixes bug #1195793
Change-Id: I4f14c9a2a4f990b753a6e1405e27eb44c53537c9
This is causing test failures if you add a new test
and don't reset the scema to {}, this seems to be timing
related. Just add Resource types that we need prevents the
need for this patching.
Change-Id: If7ddd2b1ffa8b54025c0369fe8c4f7440f0e3cdc
First step in decoupling action/status in Resource
This adjusts the Event DB columns, model and class to split
action/status, but in order to be backwards compatible we set the action
to None, which means we can do the right thing in the CFN API, and
resource_status still maps correctly to what is expected in
python-heatclient (which will need to change after the Resource
action/status split happens)
Change-Id: I261d47d2a3fdb3cdc2a8aaf6c159763f4636f633
This is stricter, but also provides plumbing for more advanced things
like fixtures and testscenarios.
Change-Id: I607b50390708ca3caa9799ef0b27007df5045a6c
Some simple cases that do not use mox still use unittest directly.
Replacing unittest.TestCase with HeatTestCase has the added benefit of
capturing all logging for reporting during failure.
Change-Id: I76192bdb91822055f1e2f7d2e806bf094d399304
This also disables the functional tests from running. The code is still
left here for posterity. These are intended to be moved into tempest
test cases and thus will be removed entirely at that time.
Change-Id: I294671baead6e83a8312b41681e99d395f861209
The structure of the program is compromised by doing too much logic in
the import phase. We can read the code more cleanly if we can see where
the intended initialization code is called. This may make tests slightly
more tedious to write, but that should be handled by writing generic
fixtures which can be reused for exactly this purpose.
Change-Id: I1d221e2f90d1f6e89717a37d2128caabd077d30a
Currently if properties.validate() fails causing the resource
to go to CREATE_FAILED state, we get an error when creating
the event, because the bad properties are evaluated in the event
constructor. Instead create a dummy Error property with the
error string for the event.
ref bug 1146529
Change-Id: I12f11de617d796d65c67a5ddb6d74c86adf67b5d
The resource.py GenericResource type is only used in tests, so
move it into the tests area, such that it can't accidentally be
used in the main heat codebase when we fail to import any resource
plugins..
Change-Id: I3912cc540903002a6dd5109e7ce51c7eb67ebf10
Leave only the actual resource implementations in the heat.engine.resources
package. This is the first step to implementing a plugin-style architecture
for resources.
Change-Id: I8a63da4f54b087ee792969678f92da8e31787a3e
Signed-off-by: Zane Bitter <zbitter@redhat.com>