Zane Bitter [Tue, 28 May 2013 08:16:37 +0000 (10:16 +0200)]
Move deletion from dependency graph to __delitem__
Graph objects are mutable, and will in future be used for operations other
than a topological sort, so abstract out the code for deleting backlinks to
a node from the other nodes that have dependencies on it when it is
removed.
Angus Salkeld [Tue, 28 May 2013 02:06:28 +0000 (12:06 +1000)]
Fix the handling of non-existing paste file
First only call find_file() by it's self so we can check for None
(abspath crashes if you pass it None)
We are already calling abspath at the return, so this
also prevents a double call to abspath.
If return None from _get_deployment_config_file() load_paste_app() will
print out a nice error message.
Liang Chen [Sun, 26 May 2013 08:55:45 +0000 (16:55 +0800)]
refactor test_engine_service.py
refactor tests based on stackServiceTestBase to be more like
the other tests, ie clear mocking, validation, and just
inherit from HeatTestCase rather than inheriting lots of
stuff from a base class, which isn't needed for all the tests
Simon Pasquier [Mon, 27 May 2013 14:20:18 +0000 (16:20 +0200)]
Fail validation when security groups and interfaces conflict
The 'SecurityGroups' property of the instance is not taken into account
by Nova when the 'NetworkInterfaces' property is also defined. Instead the
security groups should be applied to the network interface resource(s).
This issue has already raised a couple of invalid bugs on Launchpad.
Angus Salkeld [Mon, 27 May 2013 06:05:13 +0000 (16:05 +1000)]
Update the oslo code before importing a new module
Note:
- there are some new oslo dependencies pulled in.
- "six" has been added to the requirements.
- rpc messages now have a "namespace" that conflicted with
the metric namespace.
part of blueprint heat-manage
Change-Id: I92c6b91a28ca0380d13f0a3ba1544b9d517d74a8
Jeff Peeler [Fri, 24 May 2013 17:41:45 +0000 (13:41 -0400)]
Implement SecurityGroupIds property for instances
Currently handling SecurityGroups and SecurityGroupIds the same exact
way, that is both are passed directly to nova. If one wishes to pass
a security group by parameter of a group to be created in the template,
it must be in the format of <stackname>.<security group name> since
there's no way to determine the ID beforehand.
Zane Bitter [Fri, 24 May 2013 08:31:27 +0000 (10:31 +0200)]
Handle instance volume attachments with co-routines
Don't sit in a loop when attaching volumes to instances, use a task that
yields control and allows them to run in parallel - and, in future, in
parallel with other resources being created.
Steven Hardy [Thu, 23 May 2013 10:21:16 +0000 (11:21 +0100)]
engine : move update_template_diff functions into Resource
Move the update_template_diff and update_template_diff_properties
functions into resource.Resource - since they now raise
resource.UpdateReplace we can avoid ever calling handle_update if
the resource update will result in replacement
Note a further cleanup will probably be to combine the two diff
functions into one recursive diff, which will further simplify this
update_template_diff already throws resource.UpdateReplace if the
json_snippet contains changes other than to Metadata, so the else
here is unreachable and redundant
Steven Hardy [Thu, 23 May 2013 14:42:01 +0000 (15:42 +0100)]
engine : replace UPDATE_REPLACE with ResourceReplace exception
Replace the handle_update returned value with a new ResourceReplace
exception, which allows the replacement logic in resource.py and
parser.py to be cleaner
Zane Bitter [Wed, 22 May 2013 10:40:33 +0000 (12:40 +0200)]
Stub out sleeps in quantum unit tests
The patch 5d86e2f2ece51a79102aee2af9a3f306c929aaea
added wait states into the unit tests for quantum networks, routers and
ports, but did not stub out the resulting sleep. This caused the tests to
run for over 1s, which indirectly allowed bug #1182285 to become visible.
Thomas Herve [Wed, 22 May 2013 08:23:50 +0000 (10:23 +0200)]
Remove unrelated tracebacks from test output
This mocks some calls the ThreadGroup when testing update and delete of
the stack, resulting in tracebacks when the threads randomly run later
on in the test suite.
Steven Dake [Thu, 16 May 2013 04:48:36 +0000 (21:48 -0700)]
Rename requires files to standard names
From bug report:
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files and tools in the
general world are growing intelligence about them.
Steven Hardy [Tue, 21 May 2013 22:06:11 +0000 (23:06 +0100)]
engine : Fix ResourceFailure exception issues
Fix some issues spotted in https://review.openstack.org/#/c/29543
These errors were spotted after the patch was merged, the
ResourceFailure exception takes an Exception not string argument
Winson Chan [Fri, 17 May 2013 18:30:33 +0000 (11:30 -0700)]
UpdateStack for AWS::AutoScaling::ScalingPolicy
Implemented update support of the ScalingPolicy resource
in an existing stack. ScalingAdjustment, AdjustmentType,
and Cooldown properties are allowed properties for update.
A handle_update method is added to update differences in
the template.
Steven Hardy [Fri, 17 May 2013 13:20:31 +0000 (14:20 +0100)]
engine : remove unused update states/status
We have some aws-isms in the update code related to different
update states, which is not actually used anywhere, so may as
well remove it - it's probably easier at least for now to focus
on the three update states of COMPLETE/FAILED/REPLACEMENT
Steven Hardy [Fri, 17 May 2013 12:17:57 +0000 (13:17 +0100)]
engine : cleanup Resource.update error paths
The current update code uses a nasty pattern where returning an
arbitrary string from Resource.update is interpreted in parser.Stack
as an error. Instead use exceptions which is much nicer :)
Dave Wilde [Sun, 19 May 2013 10:05:39 +0000 (10:05 +0000)]
Adds sudo check for privileged operations.
Adds root user check to determine whether or not sudo is required
for MySQL status and installation. We now run sudo -l to verify
that the user is in the sudoers file, the credentials are then
cached for the rest of the operations.
Michael Still [Sat, 18 May 2013 23:17:47 +0000 (09:17 +1000)]
The utils module in oslo is no more.
The utils module in oslo has been removed (with most of its
functionality moving across to strutils). Luckily it was imported
in heat but never actually used, so removing it is relatively easy.
Monty Taylor [Thu, 16 May 2013 16:24:17 +0000 (09:24 -0700)]
Clean up a pyflakes error in a comment.
This is a little-bit silly, but it's the last thing. pyflakes parses
python lines that are in docstring comments that are prefaced by >>>.
So, without the import, pyflakes complains about undefined import.
Monty Taylor [Thu, 16 May 2013 16:20:51 +0000 (09:20 -0700)]
Align usage of test skipping.
There were three different mechanisms for skipping tests in the suite.
For the most part, skipIf was used, so sync to that. Additionally, it
was being used as a decorater in most places, but as a call in a few,
so make it a decorator everywhere. Finally, if it's on the setUp method,
it's not necessary for it to be on any of the individual tests in the class.
Steve Baker [Fri, 17 May 2013 01:47:28 +0000 (13:47 +1200)]
Initialise resources when service is created.
Without this, calls to validate_template will fail until the first
parser.Stack is created.
resources.initialise() is called in EngineService __init__
to avoid this happening in another service method in the future Fixes: bug #1181045
Change-Id: I68a74ec7993aff4b74d449a3ae33315b93e9cb0d