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.
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.
Jeff Peeler [Wed, 3 Jul 2013 14:22:25 +0000 (10:22 -0400)]
Add new attributes to EIPAssociation resource
AllocationId
NetworkInterfaceId
The EIP resource also now supports the Domain property, which when set
creates the resource using neutron networking. (Neutron networking is
required for all VPC operations.)
The EIP test covers the new functionality as well as some of the old
using both nova and neutron.
Zane Bitter [Wed, 21 Aug 2013 14:52:13 +0000 (16:52 +0200)]
Use Template to instantiate TemplateResource
Use the Template class, rather than the raw template data, to obtain the
information required to create the schema of a TemplateResource facade.
This will allow this feature to work with multiple template formats (e.g.
HOT vs. CloudFormation).
Vijendar Komalla [Wed, 21 Aug 2013 13:55:43 +0000 (08:55 -0500)]
Handling re-delete in rackspace db resource
Current implementation of db resource throws exception if the
resource was already deleted(All the other resources are not
throwing). This fix is to make db resource behavior similar to
other resources.
Clint Byrum [Tue, 20 Aug 2013 20:50:00 +0000 (13:50 -0700)]
Convert heat.common.template_format to use C yaml
Will fall back to pyyaml if CSafeLoader/CSafeDumper are not available.
This should increase template parsing performance by a factor of 9 and
reduce memory usage by an order of magnitude.
We also convert the one test that was directly calling yaml to use the
template_format.parse function, so that the same parsing is used
everywhere.
Clint Byrum [Mon, 19 Aug 2013 22:02:53 +0000 (15:02 -0700)]
Use LONGTEXT for templates in MySQL
TEXT in PostgreSQL is an unlimited column size. However, in MySQL, it is
limited to 2^16 bytes. LONGTEXT allows 2^32 bytes, which is overkill,
but will prevent MySQL from silently truncating this column and thus
rendering the entire tenant's API access moot.
Zane Bitter [Mon, 19 Aug 2013 18:51:45 +0000 (20:51 +0200)]
Allow Parameters to set defaults for TemplateResource
Although it is theoretically possible to infer default values for the
Properties of a TemplateResource from the Parameters of the provider
template, this presents a number of conversion issues that are presently
unhandled.
Instead, pass parameter values only for properties that are supplied. For
the others, allow the parameter defaults in the template to be used.