Zane Bitter [Mon, 26 Aug 2013 19:11:58 +0000 (21:11 +0200)]
Always resolve properties against the current stack
During an update, resources can get moved around between stacks. Ensure
that the properties are always resolved against whatever the current stack
is, without needing to replace self.properties.
Liang Chen [Sun, 18 Aug 2013 12:48:49 +0000 (20:48 +0800)]
Remove the rest references to exception.py
Remove the rest references to Oslo exception.py in Heat code base, so that Oslo
maintainer can go ahead and remove the openstack/common/exception.py file.
Liang Chen [Thu, 22 Aug 2013 05:42:18 +0000 (13:42 +0800)]
Allow in-place update of nested stack
Not raising UpdateReplace exception anymore for nested stack update.
Instead, propagating the update request to the nested stack, so that
the nested stack itself will decide the best way to handle the update
request for every of its resources.
Liang Chen [Thu, 22 Aug 2013 05:41:52 +0000 (13:41 +0800)]
Enhance StackResource update for more use cases
Enhance StackResource.update_with_template to accommodate more
possible use cases. This will take care of the nested stack update
failure by raising an exception in such case, so the the concrete
nested stack resource implementations will have a chance to take
some actions upon nested stack update failure.
Zane Bitter [Fri, 23 Aug 2013 23:05:47 +0000 (01:05 +0200)]
Add a method of creating a backup stack in the DB
This is a temporary storage place for resources that are going to be
deleted once their replacements are created. They must be moved out of
the stack in order to avoid conflicting with the replacement resource.
Liang Chen [Thu, 8 Aug 2013 10:11:48 +0000 (18:11 +0800)]
Evaluate lazy translation in exception __str__
The OpenStackException.__str__ method returns
self._error_string which is actually a gettextutil.Message
object not a str.
str(o) will check the return type of o.__str__() and raise
TypeError if __str__ returns non-string object.
The fix will not go into oslo as OpenStackException is
about to be deprecated. And this patch is also the first
step to remove all the references to oslo exception.py.
Zane Bitter [Fri, 23 Aug 2013 13:56:41 +0000 (15:56 +0200)]
Allow a Provider with a known facade its own schema
Allow a TemplateResource behind the facade of a known plugin to supply a
different schema to the facade resource. However, check during validation
that the two are basically compatible. The provider template must:
- Define parameters for all *required* properties of the facade.
- Define parameters that map to the same types as the facade properties.
- Not have *required* parameters that do not exist in the facade.
- Define outputs for all attributes of the facade.
Steven Hardy [Fri, 23 Aug 2013 12:26:35 +0000 (13:26 +0100)]
Only create user_creds row on initial stack store
We should only store the credentials on inital stack store,
otherwise we end up creating orphan user_creds rows every
time the stack status is updated.
Steven Hardy [Fri, 23 Aug 2013 09:57:16 +0000 (10:57 +0100)]
remove unused config options
There are several historical cut/paste unused options, which have
also now found there way into heat.conf.sample, which will confuse
users, so best to remove them.
Liang Chen [Sun, 18 Aug 2013 12:38:04 +0000 (20:38 +0800)]
Rename event logical_resource_id to resource_name
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.
Angus Salkeld [Wed, 14 Aug 2013 06:51:21 +0000 (16:51 +1000)]
Remove "lazy=joined" from the resource_data backref
This is having some weird interaction with the rsrc_metadata column.
In a later patch I add a call to resource_data_set() in signal_responder
and the metadata tests start failing.
Angus Salkeld [Thu, 22 Aug 2013 22:31:54 +0000 (08:31 +1000)]
Implement Fn::MemberListToMap
This is to allow the CloudWatch::Alarm to be implemented as
a resource template. The Dimensions need to be converted
from [{Name: bla, Value: foo}] into a normal dict.
So we define the Dimensions as a CommaDelimitedList in the template,
then in TemplateResource we see that the property is a list of dicts
and convert it into the aws style memberlist
'.member.0.Name=bla,.member.0.Value=green'
then in the CW template we can do the following:
Clint Byrum [Wed, 21 Aug 2013 20:24:17 +0000 (13:24 -0700)]
Limit maximum size of all templates
Templates of an extremely large size can eat up tons of CPU time,
memory and storage. By refusing to parse any template over a certain
size, we can prevent users from abusing the service.
Zane Bitter [Thu, 22 Aug 2013 11:01:21 +0000 (13:01 +0200)]
Pass the previous stack to StackUpdate
This starts out like the existing stack, but is not stored in the database
or updated as the stack update proceeds. This allows the StackUpdate object
to store any information that might be relevant to a future rollback.
Steve Baker [Mon, 19 Aug 2013 02:35:06 +0000 (14:35 +1200)]
Always validate auth_uri with allowed_auth_uris
The original intention was to allow heat to orchestrate
on any requested cloud when allowed_auth_uris is configured
with an empty list.
This change makes all requests be validated against
allowed_auth_uris for the following reasons:
- there is a potential security issue with requests
being authorised by a fake keystone, allowing an exploit in
heat to be executed without any valid authentication factors
first being presented.
- ec2token middleware will also need to be made multi-cloud aware
however as a compatible API it is not possible to specify the desired
auth_uri with each request. Instead ec2token will need a list of
configured endpoints so that it can try each one until a request
is authenticated.
Winson Chan [Fri, 16 Aug 2013 18:35:04 +0000 (11:35 -0700)]
Add UpdatePolicy attribute to Instance/AutoScalingGroup
This is the second part of a series to implement support
for AutoScaling UpdatePolicy.
Defined new update_policy attribute for InstanceGroup
and AutoScalingGroup, and modified init of InstanceGroup and
AutoScalingGroup to parse UpdatePolicy from the template.
Currently, only InstanceGroup and AutoScalingGroup manages
update using UpdatePolicy and so this is not implemented in the
Resource class. This can be revisited when UpdatePolicy is
applicable to other resource types. The resource validation
method is also overridden here to validate the UpdatePolicy.
Included tests to validate various uses cases of templates
with, with bad, without, and removal of UpdatePolicy. This
patch does not address handling of instances update with
UpdatePolicy yet. The next patch will address that.
Liang Chen [Wed, 21 Aug 2013 15:24:27 +0000 (23:24 +0800)]
Process request exceptions while fetching template
requests raises subclass of requests.exception.RequestException, not
IOError. And the code explicitly calls raise_for_status to avoid HTTP
errors being silently ignored.