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.
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.
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.
Ben Nemec [Thu, 15 Aug 2013 17:02:46 +0000 (12:02 -0500)]
Translate user-facing exception messages
Exception messages should be translated because they can be
visible to users. Also convert these strings to use named
format parameters in case translation reorders them.
Winson Chan [Tue, 13 Aug 2013 07:37:48 +0000 (00:37 -0700)]
Updated LaunchConfig for AutoScaling UpdatePolicy
This is the first part of a series to implement support
for AutoScaling UpdatePolicy.
Updated LaunchConfiguration resource type to return
self.physical_resource_name() in FnGetRefId(). For both
InstanceGroup and AutoScalingGroup, the property
LaunchConfigurationName is added to the list of update allowed
properties. With this change, any property change to the
LaunchConfiguration resource will be result in a different
LaunchConfigurationName on reference resolution and thus will
trigger InstanceGroup and AutoScalingGroup to handle the update.
This patchset catch the "FloatingIpPoolNotFound" exception in eip
of heat, the floatingippool cannot be configured by heat currently
but it can be assigned by setting 'default_floating_pool' in
nova.conf
Maksym Iarmak [Wed, 14 Aug 2013 15:20:12 +0000 (18:20 +0300)]
Tests for s3 and swift resources were extended
According to the description of the bug, the problem
is in the mechanism of dependencies. That is an internal
function Ref is not working properly. To repeat it, check
was added to the test templates (s3_test, swift_test). Thus,
the bug has not been reproduced.
Also, the method FnGetRefId in s3 and swift resources,
despite its name, returns the resource name in the format
'stack_name-resource_name-resource_id'. This is achieved
by the method physical_resource_name, that implemented in
superclass resource.Resource.
Instead of passing owner to the store() method of parser.Stack,
it is now maintained as an attribute of the Stack instance,
and store() will use that saved attribute when saving.
This fixes the problem of losing the owner_id on updates to
a stack.
Steve Baker [Mon, 12 Aug 2013 21:25:03 +0000 (09:25 +1200)]
Derive keystone_ec2_uri from auth_uri
ec2token auth_uri must be correctly configured for heat to work.
The /ec2tokens path is not an endpoint in its own right, it is
part of the keystone v2.0 API. The keystone_ec2_uri configuration
parameter was only used for ec2 style credentials validation in
the ec2token middleware. It might have also propagated all the
way into the user_creds table to be stored for each stack were it
not for this chain of failures (removed in this commit):
- X-Auth-EC2_URL header is set in ec2token, but header X-Auth-EC2-Url
is read by RequestContext
- RequestContext stores the ec2 uri in aws_auth_uri, but UserCreds
expects aws_auth_url
Lots of unit tests failed with the new SQLAlchemy(0.8.2)
which makes build failed, this patch will fix all the related
bug like no MutableType and changed module name in SQLAlchemy(0.8.2)
Zane Bitter [Tue, 13 Aug 2013 13:18:17 +0000 (15:18 +0200)]
Stub ResourceWithProps instead of GenericResource
Stubbing methods in a superclass is an all-or-nothing affair: once a stub
in the subclass is unset, the subclass will no longer inherit changes in
the superclass (i.e. if you then stub out the same method in the
superclass, the subclass will be unaffected).
Previously, we always set the stubs in the superclass (for historical
reasons, to avoid making this change). This would lead to tests that want
to differentiate between types (by stubbing in the derived class)
interfering with the operation of other tests. This patch changes to always
setting the stubs in the derived class.