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.
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.
Zane Bitter [Tue, 13 Aug 2013 08:48:15 +0000 (10:48 +0200)]
Remove unneccessary Property constraints from unit tests
It doesn't really make a lot of sense to have constraints on the number of
keys in a Map Property, or on the allowed values in a List Property. In
both cases, we can and should define the Schema for each item. Neither is
used anywhere in the code, since the new Schema/Constraints do not allow
it, and SchemaTest.test_all_resource_schemata() tests that all existing
schemata are valid.
Thomas Spatzier [Mon, 12 Aug 2013 16:10:48 +0000 (18:10 +0200)]
Adding HOT str_replace and get_resource functions
This patch adds support for two functions, get_resource and str_replace to HOT
to enable the definition of new HOT samples. Especially str_replace aims to
simplify the definition of scripts in HOT templates.
Luis A. Garcia [Mon, 12 Aug 2013 21:45:46 +0000 (21:45 +0000)]
Revert "Add missing _ imports to allow doc generation"
This change reverts commit 0453785f3f7b2a578b433cb0544394aac9bcfb95 and
fixes a bug where the _() was not being recognized when building the
documentation while preserving the delayed translation of error
messages.
Zane Bitter [Mon, 12 Aug 2013 09:12:33 +0000 (11:12 +0200)]
Fail fast if Resource action methods are missing
If a resource is not actually a Resource with create(), delete() &c.
methods then something has gone horribly, horribly wrong. This is not a
priority for handling gracefully at runtime.
This patch is to refactor Heat's usage to allow bringing the
policy code from oslo up to the current version to address
many fixed bugs which affect Heat.
1. Refactor the heat wrapper policy.
2. Add netaddr in requirement.txt.
3. Add necessary unit test to cover the refactor part code.
Ben Nemec [Sun, 11 Aug 2013 23:15:17 +0000 (18:15 -0500)]
Enable multi-cloud standalone mode
Adds a multi_cloud configuration parameter for auth_password that
tells a standalone Heat installation to look for its auth_url in
the request headers instead of the configuration file. Also adds
an allowed_auth_uris configuration option to specify which
auth_urls are allowed as targets.
Ben Nemec [Sat, 10 Aug 2013 01:12:23 +0000 (20:12 -0500)]
Fix problem creating ResourceFailure
The ResourceFailure exception is being instantiated improperly in
a couple of places. This changes fixes the problem and adds tests
to cover the problem cases.