Steve Baker [Wed, 5 Jun 2013 01:41:36 +0000 (13:41 +1200)]
Add Fn::Replace template function.
This is implemented with python str.replace
For yaml templates, this should be used as a better alternative to
Fn::Join: ['', [...]]
For json templates, the following common pattern:
"Fn::Join": ["", ["line 1\n", ... "line 2\n"]]
could now become more maintainable as:
"Fn::Replace": [{...}, "Fn::Join": ["\n", ["line 1", ... "line 2"]]]
Zane Bitter [Fri, 31 May 2013 10:52:30 +0000 (12:52 +0200)]
Make Fn::GetAtt add a dependency
This will ensure that resources which get attributes from other resources
are not created until the latter resources are available.
An audit of all the templates in the heat-templates repo revealed that in
only one case did this cause a circular reference, and it was the template
that appeared to be incorrect (it has since been fixed).
Steve Baker [Wed, 5 Jun 2013 21:41:44 +0000 (09:41 +1200)]
Use - instead of . for physical_resource_name delim.
Avoiding using . means that instance hostnames are unique within the stack
(and within the tenant).
This solves 2 real-world use cases:
- tripleo issue, as described in bug: #1184713
- OpenShift template resorts to setting the hostname to ec2_instance_id
This may have an impact on users who are scripting to assume . delimiting,
however this will only affect newly created stacks after this change is
deployed.
Simon Pasquier [Tue, 4 Jun 2013 14:42:50 +0000 (16:42 +0200)]
Fix instance creation when a network with no subnet is used
It is possible with OpenStack Networking to create a network with no
subnet attached to it.
When creating an instance associated to such a network, the engine would
raise a 'list index out of range' exception because the instance has no
IP address on the network.
The issue would also happen with a loadbalancer referencing the same
type of instance.
Thomas Herve [Fri, 31 May 2013 21:19:56 +0000 (14:19 -0700)]
Fix an intermitting failure in test_metadata_refresh
Given that resource creation can happen in parallel, the call to
check_create_complete may not follow the call to handle_create, so mock
those without checking the order.
Zane Bitter [Fri, 31 May 2013 19:34:36 +0000 (21:34 +0200)]
scheduler: Fix inifinite loop for no-wait tasks
When a task run by a DependencyTaskGroup completed immediately (i.e. it
was marked as done right after calling start()), the corresponding entry in
the dependency graph was never removed. As a result the DependencyTaskGroup
would continue running forever (or until it timed out).
Zane Bitter [Fri, 31 May 2013 10:39:08 +0000 (12:39 +0200)]
Implement timeouts for nested stacks
This also means that if no default is specified, nested stacks will not
time out (previously they used the default timeout of 60 minutes). Of
course, like other resources, creation of the nested stack will stop if and
when the parent stack times out.
Steven Dake [Fri, 31 May 2013 00:37:41 +0000 (17:37 -0700)]
Clarify a comment which says we require KeyName - which is incorrect
The Nova create API requires a name, image, and flavor. The key_name
is not mandatory. Possibly in AWS InstanceType (flavor) is not
mandatory but it is with Nova.
Monty Taylor [Thu, 16 May 2013 16:28:24 +0000 (09:28 -0700)]
Add CONTRIBUTING.rst file.
We don't use github pull requests, but we'd like to make that clear
to people if they show up at github and try to do one. github will
display the content of this file on the pull request submit form
if it's there.
Zane Bitter [Wed, 29 May 2013 07:25:30 +0000 (09:25 +0200)]
Clean up DB migrations when running unit tests
When doing development work, all kinds of issue can result when moving
between versions of the code that have added/removed DB migration scripts
if the compiled .pyc files are left behind. To save the need to do this
manually, remove all of the .pyc files when the unit tests are run.
Zane Bitter [Wed, 29 May 2013 07:25:30 +0000 (09:25 +0200)]
Get rid of extra delays in unit tests
Some resource types will now have at least one sleep during their creation
where previously they did not, so unit tests need to stub out the sleep if
they were not already doing so.
Clint Byrum [Wed, 29 May 2013 01:29:37 +0000 (18:29 -0700)]
Restore heat.db.sync and add Deprecated message.
This unpythonic deprecation method is used because this module was only
ever meant to be used from the CLI as 'python -m heat.db.sync'. The
module should be removable in Havana+1.
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