]> review.fuel-infra Code Review - openstack-build/heat-build.git/log
openstack-build/heat-build.git
12 years agoCreate a new heat.rpc package
Zane Bitter [Fri, 30 Nov 2012 10:05:41 +0000 (11:05 +0100)]
Create a new heat.rpc package

The definition of the RPC API is common between the engine (server) and the
clients, so move the client and common definitions out of the heat.engine
package.

Change-Id: I5fd2ba26f09c86ba1adecab4f9e06e69a694fe90
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMove template-format parsing code into common
Zane Bitter [Fri, 30 Nov 2012 13:12:38 +0000 (14:12 +0100)]
Move template-format parsing code into common

This is used mostly by the API (but also the engine for composed
templates), so it doesn't belong in the engine package.

Change-Id: I79cf8cc619a6988013a58eb4d46c014c3dcac4a3
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMove the identifier module into heat.common
Zane Bitter [Fri, 30 Nov 2012 10:38:44 +0000 (11:38 +0100)]
Move the identifier module into heat.common

It is used by both the engine and the client APIs, so it doesn't belong in
the engine.

Change-Id: I45306fd8293d1d859fde5fda9cdcf5fb0588aa2d
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRemove gen(erate)_uuid from heat.common.utils
Zane Bitter [Fri, 30 Nov 2012 14:57:48 +0000 (15:57 +0100)]
Remove gen(erate)_uuid from heat.common.utils

We now use the version from openstack-common.

Change-Id: I0ff86c73f2de1fa6e2455e2c59d1e5859634d1e9
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRemove is_uuid() from HeatIdentifier class
Zane Bitter [Fri, 30 Nov 2012 14:59:23 +0000 (15:59 +0100)]
Remove is_uuid() from HeatIdentifier class

We now use the equivalent functionality from openstack-common.

Change-Id: I915cdb92b89d3548fa03e1820d8b90b2aac4e44b
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoUse uuidutils from openstack-common
Zane Bitter [Fri, 30 Nov 2012 14:47:56 +0000 (15:47 +0100)]
Use uuidutils from openstack-common

Change-Id: I6fdd1bf59562a3dbef96da8d30c2733a801acd58
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd uuidutils from openstack-common
Zane Bitter [Fri, 30 Nov 2012 13:56:06 +0000 (14:56 +0100)]
Add uuidutils from openstack-common

Change-Id: Ia4a8e18f9a2383c09bdd9d59af3df8c057c8d35e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoUpdate openstack-common
Zane Bitter [Fri, 30 Nov 2012 13:54:07 +0000 (14:54 +0100)]
Update openstack-common

Now at oslo-incubator version 1fd7694e96da4c7e461d3c966fab1e81ee57c315

Change-Id: If6ca594185cdaf6f2b279185cb4a4f62391aa828
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRemove heat-metadata service
Steven Hardy [Wed, 28 Nov 2012 15:50:41 +0000 (15:50 +0000)]
Remove heat-metadata service

Remove heat-metadata service, since the last remaining function
(waitcondition handle notification) is now handled via the CFN
API

blueprint metsrv-remove
Signed-off-by: Steven Hardy <shardy@redhat.com>
Change-Id: Ie36c86ce86f6c47e8d9f8accf8ec17084fb8cffd

12 years agoMerge "heat engine : Convert WaitConditionHandle to pre-signed URLs"
Jenkins [Thu, 29 Nov 2012 22:35:11 +0000 (22:35 +0000)]
Merge "heat engine : Convert WaitConditionHandle to pre-signed URLs"

12 years agoMerge "heat engine : subclass keystone client to encapsulate common code"
Jenkins [Thu, 29 Nov 2012 22:31:18 +0000 (22:31 +0000)]
Merge "heat engine : subclass keystone client to encapsulate common code"

12 years agoheat engine : Convert WaitConditionHandle to pre-signed URLs
Steven Hardy [Mon, 26 Nov 2012 11:26:00 +0000 (11:26 +0000)]
heat engine : Convert WaitConditionHandle to pre-signed URLs

Change WaitConditionHandle so it provides a pre-signed URL which
allows authenticated wait condition notification via the CFN API

blueprint metsrv-remove
Change-Id: I5c1c3a17ade35c810e49b1f27d80bcfea9e89485
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : subclass keystone client to encapsulate common code
Steven Hardy [Fri, 23 Nov 2012 10:41:03 +0000 (10:41 +0000)]
heat engine : subclass keystone client to encapsulate common code

Encapsulate the keystone client in a heat-specific wrapper subclass
so we can put heat-specific implementation related to keystone in
one place.  This will allow easier reuse of common code between
resources which need to manipulate stack users and ec2 keys

blueprint metsrv-remove
Change-Id: I3d9751023c52cb75ab5e1f62415b1db4e4361dec
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoProcess engine config before initialisation
Zane Bitter [Thu, 29 Nov 2012 19:51:01 +0000 (20:51 +0100)]
Process engine config before initialisation

Don't import the heat-engine service module until the configuration options
have been initialised. This will allow us to read the configuration during
initialisation of the engine.

Change-Id: I2bc70d903434eac1fa248640018f038c5ef2bead
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoheat api : add waitcondition to cfn api
Steven Hardy [Thu, 22 Nov 2012 17:11:15 +0000 (17:11 +0000)]
heat api : add waitcondition to cfn api

Add a new path to the CFN api, which implements CFN style waitcondition
notification - this means we can move away from the separate heat-metadata
service for this purpose, instead using the authenticated CFN API

blueprint metsrv-remove
Change-Id: I62cff7cb4c7a009fea2c8f62ea446d8d758f5429
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoAdd documentation on plugin_loader module
Zane Bitter [Thu, 29 Nov 2012 11:50:48 +0000 (12:50 +0100)]
Add documentation on plugin_loader module

Change-Id: I55a6c90c8bacee8a3bfed297b150cf5554cfabba
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoLookup the class for an Instance in Autoscaling
Zane Bitter [Tue, 27 Nov 2012 14:13:55 +0000 (15:13 +0100)]
Lookup the class for an Instance in Autoscaling

Instead of hardcoding the class for handling instances in autoscaling,
look up the class for the AWS::EC2::Instance resource type using the same
mechanism used for creating resources normally.

Change-Id: I37b9aff9a83b89cdc782467720970a04549d7b1e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRefactor autoscaling Instance creation
Zane Bitter [Tue, 27 Nov 2012 15:36:50 +0000 (16:36 +0100)]
Refactor autoscaling Instance creation

Change-Id: I5d545500f1bc71222ce2c599f57d2d373990da73
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoLoad resources dynamically
Zane Bitter [Tue, 27 Nov 2012 15:15:56 +0000 (16:15 +0100)]
Load resources dynamically

Automatically load all resources as "plugins" when importing the package
heat.engine.resources, instead of having to list them explicitly.

Change-Id: I9d11ab9a5b1dd21bc5f9c2f0aad95c035a9c9aa0
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd a module for dynamically loading plugins
Zane Bitter [Tue, 27 Nov 2012 14:41:57 +0000 (15:41 +0100)]
Add a module for dynamically loading plugins

Change-Id: I662b5989941b467c78a392098db0cd19ff86201c
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoDistribute resource mapping to individual modules
Zane Bitter [Tue, 27 Nov 2012 14:38:44 +0000 (15:38 +0100)]
Distribute resource mapping to individual modules

Define the mapping from resource names to classes locally in each module
and then aggregate them. This moves the mappings near the definitions, and
provides the format for an eventual plug-in resource architecture.

Change-Id: I3e70d495c5a490ae20d38bf1aec7e28080a55520
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMove the resource module out of the resources package
Zane Bitter [Wed, 28 Nov 2012 13:43:40 +0000 (14:43 +0100)]
Move the resource module out of the resources package

Leave only the actual resource implementations in the heat.engine.resources
package. This is the first step to implementing a plugin-style architecture
for resources.

Change-Id: I8a63da4f54b087ee792969678f92da8e31787a3e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRemove YAML template trailing spaces
Steve Baker [Tue, 27 Nov 2012 02:23:40 +0000 (15:23 +1300)]
Remove YAML template trailing spaces

Change-Id: I36ae27a44bd9863df63bdff144f1773c774661b4

12 years agoConvert some existing templates to YAML format.
Steve Baker [Mon, 26 Nov 2012 00:07:51 +0000 (13:07 +1300)]
Convert some existing templates to YAML format.

This is the result of running:
python tools/cfn-json2yaml templates/
and then cleaning up by hand to be more consistant, readable and
maintainable.

The following templates are enforced to parse to identical stacks
in the unit tests so any fundamental change to one must be made
to the other.

Quantum.template
Quantum.yaml

WordPress_Single_Instance.template
WordPress_Single_Instance.yaml

Change-Id: Ibe05a5c5a7a5bb1861c5f84a3dc41e2d632852fd

12 years agoFor Fn::Join join strings in resolve_static_data
Steve Baker [Tue, 27 Nov 2012 00:50:20 +0000 (13:50 +1300)]
For Fn::Join join strings in resolve_static_data

Fn::Join now has some preprocessing in resolve_static_data
where contiguous strings are joined into a single string.

This will allow equivalence tests to pass when comparing
JSON templates to hand-tidied YAML

Change-Id: I49fb2456388b3fd554ccec00920d7e84f6998183

12 years agoSet default empty dicts for missing sections
Steve Baker [Mon, 26 Nov 2012 23:48:05 +0000 (12:48 +1300)]
Set default empty dicts for missing sections

So that the YAML format can be more terse, make empty version and
sections imply the lastest version and an empty dict for the
section content.

Change-Id: Ic8b86065534930852fff1488849dbbbbb6b85243

12 years agoDon't assume parsed JSON in REST API.
Steve Baker [Mon, 26 Nov 2012 00:52:34 +0000 (13:52 +1300)]
Don't assume parsed JSON in REST API.

This checks to see if the 'template' attribute is a dict.

If not it uses format.parse_to_template to parse it.
Change-Id: Ic9b9ef3e88a33a93d5896277cc3d4da4fd55fc25

12 years agoMerge "pip-requires fix boto version"
Jenkins [Mon, 26 Nov 2012 19:28:14 +0000 (19:28 +0000)]
Merge "pip-requires fix boto version"

12 years agocfn-json2yaml file-mode bugfix
Steven Hardy [Mon, 26 Nov 2012 18:14:16 +0000 (18:14 +0000)]
cfn-json2yaml file-mode bugfix

file-mode wasn't working, also add missing header

Change-Id: I75d15fd73de4ab3ce679ae3a274ec1c402802267
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agopip-requires fix boto version
Steven Hardy [Mon, 26 Nov 2012 13:51:03 +0000 (13:51 +0000)]
pip-requires fix boto version

Boto version added to pip-requires is wrong - we need a version containing
the commit discussed under https://github.com/boto/boto/pull/742, which is
only included in boto>=2.4.0

Change-Id: Iaaa61f306d4035e63ca3f7a0eafe2d5715585f16
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoUtility to convert JSON template files to YAML
Steve Baker [Thu, 22 Nov 2012 19:15:15 +0000 (08:15 +1300)]
Utility to convert JSON template files to YAML

Accepts a directory or file path.

Change-Id: Icd51db5484283372a2b5fb8c681b0e88c7a9c1d5

12 years agoFor tests, Parse all templates with parse_to_template
Steve Baker [Mon, 26 Nov 2012 00:04:35 +0000 (13:04 +1300)]
For tests, Parse all templates with parse_to_template

Change-Id: Iedb6929f46dddbb888a7248034864855b5cd0205

12 years agoParse all templates with format.parse_to_template
Steve Baker [Mon, 26 Nov 2012 00:01:11 +0000 (13:01 +1300)]
Parse all templates with format.parse_to_template

It can no longer be assumed that a template string is in JSON format.

Change-Id: Id43b82a25e62f7c7868c1c51556c5bde94e7b132

12 years agoModule for converting JSON to YAML, and parsing both
Steve Baker [Sun, 25 Nov 2012 23:52:47 +0000 (12:52 +1300)]
Module for converting JSON to YAML, and parsing both

convert_json_to_yaml is a utility function used for tests and file conversion
utilities.

parse_to_template will take any string, infer the format, and parse to a
python structure. Currently it assumes the file is JSON if it starts with '{'
otherwise it attempts to parse it as YAML.

Change-Id: If15ccdaf912693f76b74bb1fe879145af1cb36b1

12 years agoAdd packages and versions in response to grizzly-1
Steve Baker [Mon, 26 Nov 2012 01:34:38 +0000 (14:34 +1300)]
Add packages and versions in response to grizzly-1

- Paste is now PasteDeploy
- boto is now an explicit requirement
- python-glanceclient replaces removed glance client
- added PyYAML for new YAML format

Change-Id: I59e11a45f7cc77007e259e5dd1b216e691c5f116

12 years agoHAProxy example had incorrect descriptions
Jesse Andrews [Fri, 23 Nov 2012 05:17:13 +0000 (21:17 -0800)]
HAProxy example had incorrect descriptions

Change-Id: Ibc14297159e6e0c0b159d214539a5030d4af573e

12 years agoReST API: Add Events
Zane Bitter [Thu, 22 Nov 2012 10:06:57 +0000 (11:06 +0100)]
ReST API: Add Events

Change-Id: I716dc2ad1c9294a7a9df27fbb77e32926b1ba307
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoCFN API: Rename ID formatting method
Zane Bitter [Thu, 22 Nov 2012 13:09:56 +0000 (14:09 +0100)]
CFN API: Rename ID formatting method

It now formats event IDs as well as stack IDs.

Change-Id: Iec288eec68cbbebd911a4cf5bfdad96c20dc60f0
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRPC API: Return an identifier for events
Zane Bitter [Thu, 22 Nov 2012 10:06:57 +0000 (11:06 +0100)]
RPC API: Return an identifier for events

Change-Id: Iae2f08014e28997e499771ba9d89feb3954540da
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoUse the new class for database access to Events
Zane Bitter [Thu, 22 Nov 2012 10:06:57 +0000 (11:06 +0100)]
Use the new class for database access to Events

Change-Id: I6c02cf47869aaa1d293cb1b528ed967397c47208
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd a class to represent Events
Zane Bitter [Thu, 22 Nov 2012 10:06:57 +0000 (11:06 +0100)]
Add a class to represent Events

Change-Id: Ie360343a264f2348af518c8f8eb8cfa0763ad18c
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd a method for querying a resource's type
Zane Bitter [Thu, 22 Nov 2012 10:06:57 +0000 (11:06 +0100)]
Add a method for querying a resource's type

Change-Id: Ie07a01668c5958494631806ffc0748f659eb8a1b
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd identifiers for Events
Zane Bitter [Thu, 22 Nov 2012 10:06:56 +0000 (11:06 +0100)]
Add identifiers for Events

Change-Id: I54b2d2bb56129314218f36889f0f525e88c9f146
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoImprove the identifier class for Resources
Zane Bitter [Thu, 22 Nov 2012 10:06:56 +0000 (11:06 +0100)]
Improve the identifier class for Resources

Enable the resource name to be retrieved from an object. Also allow a
ResourceIdentifier to be constructed from only the data passed through the
RPC API. This means we can use a single format for identifiers, but still
be able to extract important information such as the stack identifier and
resource name.

Change-Id: Ie9122cb1a835b30eb8e0713a9d5cdcb4a386eda7
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMerge "Get db session from the context."
Jenkins [Wed, 21 Nov 2012 19:46:31 +0000 (19:46 +0000)]
Merge "Get db session from the context."

12 years agoMerge "Use a real context for tests."
Jenkins [Wed, 21 Nov 2012 19:31:19 +0000 (19:31 +0000)]
Merge "Use a real context for tests."

12 years agoGet db session from the context.
Steve Baker [Wed, 21 Nov 2012 19:15:05 +0000 (08:15 +1300)]
Get db session from the context.

The aim is to use a single sqlalchemy session for an RPC request.

The context object passed to EngineAPI methods is actually an RpcContext
which contains the same data as the RequestContext. The @request_context
decorator turns this back into a RequestContext which can now have other
behaviours added to it.

RequestContext now has a lazy loaded session attribute.

Save calls on created entities need to be passed the shared session.

Change-Id: Ied4e66deaca205362b84fb698f75cc872886607d

12 years agoUse a real context for tests.
Steve Baker [Wed, 21 Nov 2012 19:13:33 +0000 (08:13 +1300)]
Use a real context for tests.

No more DummyContext.

Change-Id: Ifbb7cea17b9fa0df90c15867712a74f4d8a5115d

12 years agoheat engine retrieve credentials every periodic task interval
Steven Hardy [Wed, 21 Nov 2012 11:34:51 +0000 (11:34 +0000)]
heat engine retrieve credentials every periodic task interval

Avoid saving a session context, instead retrieve the DB stored
credentials for every periodic task trigger, and create a new
session context for each periodic event

Change-Id: I24ca70b478f06be26ca6cc74385b37d1a0cf098d
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine Add admin flag to dbapi stack_get
Steven Hardy [Wed, 21 Nov 2012 11:31:14 +0000 (11:31 +0000)]
heat engine Add admin flag to dbapi stack_get

Add a flag to the stack_get dbapi call, defaulted to False,
which allows us to specify that the admin context is being used
hence we don't want tenant-scoping condition applied.
This is needed to allow the admin context to retrieve stored
credentials per-stack (e.g for the periodic per-stack tasks)

Change-Id: I55e307b7940f7da13bd169271744e80d95ea0bd9
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoTool to download all Amazon example templates
Steve Baker [Tue, 20 Nov 2012 03:24:23 +0000 (16:24 +1300)]
Tool to download all Amazon example templates

Templates are saved in templates/cloudformation-examples which is ignored
by git.

Its probably time we're exposed to a bit more template diversity.

Change-Id: I667c4f08fced353201ab9234a51526bcbeb0761b

12 years agoMerge "heat engine allow WatchRule load() from DB object"
Jenkins [Mon, 19 Nov 2012 22:57:31 +0000 (22:57 +0000)]
Merge "heat engine allow WatchRule load() from DB object"

12 years agoMerge "heat engine move to per-stack periodic watch threads"
Jenkins [Mon, 19 Nov 2012 22:55:30 +0000 (22:55 +0000)]
Merge "heat engine move to per-stack periodic watch threads"

12 years agoMerge "add watch_rule_get_all_by_stack dbapi call"
Jenkins [Mon, 19 Nov 2012 22:54:53 +0000 (22:54 +0000)]
Merge "add watch_rule_get_all_by_stack dbapi call"

12 years agoMerge "Make CloudWatchAlarm names unique per-tenant"
Jenkins [Mon, 19 Nov 2012 22:52:49 +0000 (22:52 +0000)]
Merge "Make CloudWatchAlarm names unique per-tenant"

12 years agoMerge "WatchRule refer to stack by id not name"
Jenkins [Mon, 19 Nov 2012 22:51:58 +0000 (22:51 +0000)]
Merge "WatchRule refer to stack by id not name"

12 years agor1 not defined
Angus Salkeld [Mon, 19 Nov 2012 04:18:54 +0000 (15:18 +1100)]
r1 not defined

Change-Id: Icd1135f17512248d5c212ba88add386212510641

12 years agoRemove unused statements/local assignments
Angus Salkeld [Mon, 19 Nov 2012 04:08:53 +0000 (15:08 +1100)]
Remove unused statements/local assignments

Change-Id: Iabc1932ef4f851567c30719de127e1165f23dd90

12 years agoheat engine allow WatchRule load() from DB object
Steven Hardy [Mon, 19 Nov 2012 22:23:24 +0000 (22:23 +0000)]
heat engine allow WatchRule load() from DB object

Allow WatchRule.load to initialize an object based on an existing
sqlalchemy DB object, similar to parser.Stack, avoids doing two
DB lookups when running the periodic watch tasks

Change-Id: I280942b81e5fdee17acf5582e3d319045afa7914
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine move to per-stack periodic watch threads
Steven Hardy [Mon, 19 Nov 2012 16:55:23 +0000 (16:55 +0000)]
heat engine move to per-stack periodic watch threads

Use the stack thread groups, so a separate watch thread is started
for each stack - this avoids some of the context scoping problems
previously encountered since we can pass the correct context to the
periodic task when starting it

Fixes bug 1078779

Change-Id: I56e6a4b126199587e91548f450956d77ab2158f3
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoadd watch_rule_get_all_by_stack dbapi call
Steven Hardy [Mon, 19 Nov 2012 16:26:12 +0000 (16:26 +0000)]
add watch_rule_get_all_by_stack dbapi call

Add option to retrieve all watch rules for a given stack, which
will be required to move to periodic watch threads per-stack

Ref bug 1078779

Change-Id: I350e2ee72c7eec0b91bf85ac52bb04e3cd00b4db
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoMake CloudWatchAlarm names unique per-tenant
Steven Hardy [Mon, 19 Nov 2012 15:31:01 +0000 (15:31 +0000)]
Make CloudWatchAlarm names unique per-tenant

Use physical_resource_name to ensure CloudWatchAlarm resources
are unique per tenant

Ref bug 1078779

Change-Id: Id37393decd8d4f89e79af5c7e9eeb21f4e494699
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoWatchRule refer to stack by id not name
Steven Hardy [Wed, 14 Nov 2012 15:41:17 +0000 (15:41 +0000)]
WatchRule refer to stack by id not name

Rework WatchRule to refer to stacks by uuid not name, this will
help us move to allowing non-unique stack names containing WatchRule
resources

Ref bug 1078779

Change-Id: Idbbbd65a05d7036860cc2feb044d568210071d21
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoProvide more information with template URL error
Jeff Peeler [Mon, 19 Nov 2012 17:10:12 +0000 (12:10 -0500)]
Provide more information with template URL error

Previously a generic read error was given. Inform the user with proper
exceptions for: the case when a resource is present but non-responsive
and when a resource is present but the requested data could not be
found.

Fixes bug 1072951

Change-Id: I35b92cea38358691015f8752e80efc6720e34e48
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
12 years agoAdd missing logging imports
Angus Salkeld [Mon, 19 Nov 2012 04:05:42 +0000 (15:05 +1100)]
Add missing logging imports

Change-Id: Ide1d0a27337bfaf767cf85d59deef1752724fbcf

12 years agoUse jsonutils in ec2token
Angus Salkeld [Mon, 19 Nov 2012 04:04:44 +0000 (15:04 +1100)]
Use jsonutils in ec2token

To get access to to_primitive()

Change-Id: I9a09609b5469870a217386be9fbad9261ef0c815

12 years agoRemove unused imports
Angus Salkeld [Mon, 19 Nov 2012 05:11:50 +0000 (16:11 +1100)]
Remove unused imports

Change-Id: I4977a34b758f3dd2b5a4772dc074af2f0c715175

12 years agoFix ppetit.template parameter type Integer -> Number
Angus Salkeld [Mon, 19 Nov 2012 01:12:35 +0000 (12:12 +1100)]
Fix ppetit.template parameter type Integer -> Number

part of bug 1072896
Change-Id: I47011d14330f8d8015876a88529a399a1cee98b6

12 years agoRPC API: Get rid of event_create call
Zane Bitter [Fri, 16 Nov 2012 14:50:03 +0000 (15:50 +0100)]
RPC API: Get rid of event_create call

Nothing is using this.

Change-Id: Id97ce0af1e176463b92288022765f80e1b5152ed
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoReST API: Add a convenience redirect for resources
Zane Bitter [Wed, 14 Nov 2012 16:51:26 +0000 (17:51 +0100)]
ReST API: Add a convenience redirect for resources

Since the path stacks/{stack_name}/{stack_id}/resources exists for each
valid stack we can safely redirect to it from stacks/{stack_name}/resources
without having to perform any further checks in the engine, so we may as
well allow it.

Change-Id: I0169493479f8c6840de3edad271cf98e8fd5d1da
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoReST API: Add API for Resources
Zane Bitter [Mon, 12 Nov 2012 16:42:37 +0000 (17:42 +0100)]
ReST API: Add API for Resources

Change-Id: I860349d03a2d7d034c600a129aead59964930b02
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRPC API: Include less detail in resource list
Zane Bitter [Fri, 16 Nov 2012 11:10:21 +0000 (12:10 +0100)]
RPC API: Include less detail in resource list

Since the stack_list_resources command could be returning data for a large
number of resources, avoid returning the metadata and description (which
are not needed) to save space.

Change-Id: I4e3a46315952f8dd451410622de0d68423abbbf2
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRefactor unit tests for ReST API
Zane Bitter [Fri, 16 Nov 2012 10:36:39 +0000 (11:36 +0100)]
Refactor unit tests for ReST API

This makes it easier to add tests for different controllers.

Change-Id: I549295ebdd9a41ca4c184c0ff242c805399656c5
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoReST API: Move remote error handler to utils module
Zane Bitter [Fri, 16 Nov 2012 09:58:34 +0000 (10:58 +0100)]
ReST API: Move remote error handler to utils module

Change-Id: Id3b99c62c01f1c22aa39518bb0f650d41f5975f0
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRPC API: Return a resource identifier
Zane Bitter [Mon, 12 Nov 2012 16:42:37 +0000 (17:42 +0100)]
RPC API: Return a resource identifier

Change-Id: Ica33a82a8a201f625f293292e1ae7e5ca26559ef
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd identifiers for resources
Zane Bitter [Mon, 12 Nov 2012 16:42:36 +0000 (17:42 +0100)]
Add identifiers for resources

Change-Id: I5d0477ba8ee681f14b0f54cf8fa4d8569d541f88
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoReST API: Refactor routes
Zane Bitter [Mon, 12 Nov 2012 16:42:36 +0000 (17:42 +0100)]
ReST API: Refactor routes

Change-Id: I2ab3c266ea814e791bc7fd955f8502ca862a92d5
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoheat engine : remove now-unused metadata rpc calls
Steven Hardy [Thu, 15 Nov 2012 11:28:30 +0000 (11:28 +0000)]
heat engine : remove now-unused metadata rpc calls

Remove metadata_(list|get)* calls, as these are no longer used by
heat-metadata hence are no-longer required

Change-Id: Ia67b9f329f628e3172bba24ff1b1192e8ec18079
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat workaround for HA/Autoscaling regression
Steven Hardy [Thu, 15 Nov 2012 10:03:46 +0000 (10:03 +0000)]
heat workaround for HA/Autoscaling regression

Interim workaround for HA/Autoscaling regression, caused by change of
scope for stack_get_by_name to be per-tenant, meaning we need to do a
brute-force lookup to find the stack entry when using the stored admin
context.

A better, more comprehensive (but more intrusive) fix is in-progress
but this at least returns us to the same functionality we had before

Note this means that all stacks using WatchRule still need to have names
unique accross all tenants.

bug 1078779

Change-Id: Iad1830d38262d1afb63cee16a3e366d9fd09acb4
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat dbapi rename stack_get_by_tenant
Steven Hardy [Thu, 15 Nov 2012 09:12:31 +0000 (09:12 +0000)]
heat dbapi rename stack_get_by_tenant

Rename stack_get_by_tenant to stack_get_all_by_tenant
This aligns better with other dbapi calls and better describes
the actual purpose of the call

Change-Id: If410220f8423f31718e6bcbfeca62a45c94c4d18
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoMerge "Allow stack.owner_id to store a uuid."
Jenkins [Wed, 14 Nov 2012 21:58:20 +0000 (21:58 +0000)]
Merge "Allow stack.owner_id to store a uuid."

12 years agoAllow stack.owner_id to store a uuid.
Steve Baker [Wed, 14 Nov 2012 20:11:47 +0000 (09:11 +1300)]
Allow stack.owner_id to store a uuid.

Fixes bug 1078854

Change-Id: I3dae1502968853d563ba52bc1d6656c48d5d18ba

12 years agoReST API: Split utilities into a separate module
Zane Bitter [Mon, 12 Nov 2012 16:42:36 +0000 (17:42 +0100)]
ReST API: Split utilities into a separate module

Change-Id: I140193db16b999255912f7013827b87b9ceb26e5
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoActually validate properties of resources
Zane Bitter [Mon, 12 Nov 2012 16:42:36 +0000 (17:42 +0100)]
Actually validate properties of resources

Properties.validate() returns an error on failure; it does not raise an
exception (and never has). So we should look at the return value when we
call it.

Change-Id: Iaa0deb9f54055b4b1f73c0b37d26f5ac2c00d683
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoGetting Started: Fix formatting errors
Zane Bitter [Wed, 14 Nov 2012 14:16:54 +0000 (15:16 +0100)]
Getting Started: Fix formatting errors

Change-Id: If174fe7f54caa227996d0d779b28be8eb2050888
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoheat templates : align autoscaling alarm descriptions with values
Steven Hardy [Tue, 13 Nov 2012 09:54:40 +0000 (09:54 +0000)]
heat templates : align autoscaling alarm descriptions with values

The description doesn't match the actual values for the alarms

Change-Id: I46201b75be075f4e4ac32d40031bc17b0786bb1f
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : create boto config via instance userdata
Steven Hardy [Tue, 13 Nov 2012 09:48:49 +0000 (09:48 +0000)]
heat engine : create boto config via instance userdata

Create boto config via instance userdata, which the instance
cfntools can read instead of /etc/boto.cfg, avoids messy post
install sed-mangling in the templates

Change-Id: Ic94bfc2e362a3a3f93b9bdeaad6a5f988371346e
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : append watch server url to instance userdata
Steven Hardy [Mon, 12 Nov 2012 18:31:16 +0000 (18:31 +0000)]
heat engine : append watch server url to instance userdata

Append url for watch server to instance userdata, which avoids
post-install sed mangling in the template, and will make it easier
to transparently switch to a different metric service

Change-Id: I59b9b7efcd75d44e88ebe0a116a9ce1e3ef20c14
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoDon't use OpenStack plugin in tox
Zane Bitter [Tue, 13 Nov 2012 17:19:12 +0000 (18:19 +0100)]
Don't use OpenStack plugin in tox

This plugin provides syntax colouring of the tox output, at the cost of no
longer reporting errors in test setup (instead it just reports no tests run
-> success).

Change-Id: Idf4f71a54af6303090d464b0846e563ac3776e4a
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAlways filter by tenant_id in stack_get_by_name.
Steve Baker [Wed, 14 Nov 2012 03:23:12 +0000 (16:23 +1300)]
Always filter by tenant_id in stack_get_by_name.

This means that all calls to stack_get_by_name need to provide a context.

Without this change, 2 tenants cannot create stacks with the same name.

Change-Id: I98c35a5d51c5c7d66e0b8a0fddc04f221d1d6ab7

12 years agoAlign pip-requires versions with nova
Steve Baker [Tue, 13 Nov 2012 22:17:52 +0000 (11:17 +1300)]
Align pip-requires versions with nova

This should also make the unit tests run again by preventing
SqlAlchemy 8 from being used

Change-Id: I6fa92540dc3369b85d135232b10701937071cbd6

12 years agoheat align openstack/common with latest oslo-incubator
Steven Hardy [Tue, 13 Nov 2012 08:47:44 +0000 (08:47 +0000)]
heat align openstack/common with latest oslo-incubator

Pull in the latest oslo changes, we need the threadgroup fix
Fixes 1078064

Change-Id: I58cc94979558663d101a1a7b42446d1a9face6cf
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoModify identify_stack to check for uuid.
Steve Baker [Tue, 13 Nov 2012 01:30:15 +0000 (14:30 +1300)]
Modify identify_stack to check for uuid.

If the passed name matches a uuid then lookup by uuid instead of name.

Change-Id: I2058616ce0191aab4d364b652f1b20d072f6b258

12 years agoheat engine : Don't wait() for killed greenthreads
Steven Hardy [Mon, 12 Nov 2012 19:59:58 +0000 (19:59 +0000)]
heat engine : Don't wait() for killed greenthreads

We don't care about the return value of any killed threads on
delete_stack, and the greenthreads will all raise a GreenletExit
exception after being kill()'d anyway.
Also see related openstack-common fix : https://review.openstack.org/15906

Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoPass a Stack entity to Stack.load().
Steve Baker [Sun, 11 Nov 2012 19:38:38 +0000 (08:38 +1300)]
Pass a Stack entity to Stack.load().

Every call to Stack.load (except one) is loading models.Stack then passing just
the ID to Stack.load, which then loads models.Stack again.

As far as I can tell, SQLAlchemy doesn't have a 2nd level cache, so this results
in the db being queried twice.

This change makes it possibe to pass a stack *or* an ID to Stack.load, and
converts all calls to pass in a stack if it is available.

Change-Id: I501ebd403a241cc3b4a5c1e3070137cfc360bbda

12 years agoMerge "Switch to UUID for the Stack primary key."
Jenkins [Fri, 9 Nov 2012 11:16:05 +0000 (11:16 +0000)]
Merge "Switch to UUID for the Stack primary key."

12 years agoSwitch to UUID for the Stack primary key.
Steve Baker [Fri, 9 Nov 2012 02:45:06 +0000 (15:45 +1300)]
Switch to UUID for the Stack primary key.

For the migrate upgrade, existing integer keys remain and any subsequent stack
will be assigned a uuid.

For a migrate downgrade, it should work fine if there have been no stacks added
since ugrade. Added stacks will have their IDs 'truncated' back to an integer
which will require some manual fixup after downgrade.

Change-Id: Ib882bece911fcbc96fffab16a9f0e5ce3cb55fed

12 years agoAdd a list_stacks RPC call.
Steve Baker [Thu, 8 Nov 2012 19:43:23 +0000 (08:43 +1300)]
Add a list_stacks RPC call.

This differs from the old show_stack(None) by not resolving stack data.

heat list does not display any of the resolved stack data. Resolving outputs
can be especially slow since FnGetAtt may block while it calls out
to another service (such as with the quantum resources).

Without this change, running heat list on a single Quantum.template takes 1.8s
vs 0.7s.

In the future, list_stacks can be made to support paging of results.

Change-Id: Iae30338b66912d660f1cf48119893b1ab593b67a

12 years agoRename instance_id to resource_id.
Steve Baker [Thu, 8 Nov 2012 03:39:18 +0000 (16:39 +1300)]
Rename instance_id to resource_id.

The current naming gets increasingly inaccurate with every new resource ;)

Change-Id: I98629c7f8fd9c391f58c16ae1f6f2a7a232a2802

12 years agoMove client connection out of resources.py.
Steve Baker [Thu, 8 Nov 2012 02:49:19 +0000 (15:49 +1300)]
Move client connection out of resources.py.

Client connection references are currently cached at the resource instance
level, which doesn't seem very useful.

This change moves the client connection and caching to clients.py, then puts a
Clients instance in a Stack. This means that (for example) all requests to nova
in one stack will come from the same client instance.

Change-Id: I22519f8ae4278ad128d3785d090294285f3a1b89