]> review.fuel-infra Code Review - openstack-build/heat-build.git/log
openstack-build/heat-build.git
12 years agoUse common implementation for fetching templates
Zane Bitter [Thu, 6 Dec 2012 19:12:06 +0000 (20:12 +0100)]
Use common implementation for fetching templates

bug 1072908

Change-Id: Idad06e8c28cbaed121604bb0de5f79edfacb1efb
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd a common implementation for fetching a URL
Zane Bitter [Thu, 6 Dec 2012 18:35:05 +0000 (19:35 +0100)]
Add a common implementation for fetching a URL

There are multiple implementations of fetching a template from a URL, so
add a common one where changes can be shared.

Change-Id: I9c834efa71f97360dafb741e26713e3f3c124b6f
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoPass string to template_format.parse()
Zane Bitter [Thu, 6 Dec 2012 19:15:27 +0000 (20:15 +0100)]
Pass string to template_format.parse()

Since template_format.parse() attempts to guess the type of the input
instead of using yaml.parse for everything, the input must be a string and
not a stream, even though yaml.parse() can handle either.

Change-Id: I07dc13a54492f3f6db17bfca3cc9e129c765eed5
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoResource.__eq__ allow resources in different stacks
Steve Baker [Wed, 5 Dec 2012 22:53:45 +0000 (11:53 +1300)]
Resource.__eq__ allow resources in different stacks

Doing a stack update was incorrectly replacing identical resources
because Refs in the new resource were evaluating to None in the new stack.

This change allows an alternative template to be passed to parsed_template
and modifies __eq__ to compare the two templates in the same stack.

__eq__ now also checks that the name of both resources matches, since a stack
could have multiple identical resources with different names.

Change-Id: I7e09ee1238dd01490cdfe186c51b7fada9546a63

12 years agoFix importing of quantum resources subpackage
Zane Bitter [Wed, 5 Dec 2012 10:15:42 +0000 (11:15 +0100)]
Fix importing of quantum resources subpackage

Apparently pkgutil.walk_packages(path) will return packages outside the
given path if they have the same names as the ones inside - so having a
quantum subpackage results in importing the global quantum package from
Quantum itself instead. Fix this by passing a package prefix to give a
fully qualified name.

Also make sure that submodules are added as an attribute to their immediate
parent package, not to some grandparent package with '.'s in the attribute
name.

bug 1085725

Change-Id: Ie571100898a33ed4fe15d1878c7b16db4caf4fa5
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoDo the same install_requires as other projects
Steve Baker [Wed, 5 Dec 2012 01:14:48 +0000 (14:14 +1300)]
Do the same install_requires as other projects

This will pull in tools/pip-requires on devstack start

Change-Id: If93319c82a5e3499391e8624582929d4f1adc9ec

12 years agoInstall extras during pip install; fixes devstack
Steve Baker [Wed, 5 Dec 2012 00:58:22 +0000 (13:58 +1300)]
Install extras during pip install; fixes devstack

Change-Id: Ia1252d95fa7023d440b293245fe15d2c4ebfc047

12 years agoMerge "heat getting started, add pip install extras"
Jenkins [Mon, 3 Dec 2012 23:11:24 +0000 (23:11 +0000)]
Merge "heat getting started, add pip install extras"

12 years agoMerge "heat remove unused config options"
Jenkins [Mon, 3 Dec 2012 20:01:14 +0000 (20:01 +0000)]
Merge "heat remove unused config options"

12 years agoheat remove unused config options
Steven Hardy [Mon, 3 Dec 2012 14:53:59 +0000 (14:53 +0000)]
heat remove unused config options

Remove metadata* config options - these were actually never used by
the metadata service, and look to be cut/paste artefacts from the
nova codebase.

Change-Id: I50b7d48bfaf82d4b1af7ad269ef329ec455c0f04
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat getting started, add pip install extras
Steven Hardy [Mon, 3 Dec 2012 14:43:14 +0000 (14:43 +0000)]
heat getting started, add pip install extras

Add install of extras via pip, as we now depend on it via oslo
and it's not yet packaged for Fedora

ref bug 1085970

Change-Id: I08f2962e091e0bdb0c9bdc6d25f319e042f858f5
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : remove KeystoneClient get_user_by_name
Steven Hardy [Mon, 3 Dec 2012 11:06:56 +0000 (11:06 +0000)]
heat engine : remove KeystoneClient get_user_by_name

Remove get_user_by_name as it's no longer used, and we want to
avoid this style of name->id lookup because it requires keystone
admin role.

Change-Id: I234a235864ac7537df09cae2f07d99ed9d53acd2
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : Rework AccessKey to avoid keystone user lookup
Steven Hardy [Mon, 3 Dec 2012 11:04:12 +0000 (11:04 +0000)]
heat engine : Rework AccessKey to avoid keystone user lookup

Rework the mapping if AccessKey UserName property to keystone
user_id - the recent refactor reintroduces a keystone.user.list
call, which requires admin role, which we want to avoid or the
in-instance user can't request their own secret key via cfn-hup

ref bug 1085049

Change-Id: I456dff67f56336a9052180dc3c59cea8b7a173bd
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoMerge "Make sure heat uses its own control_exchange"
Jenkins [Mon, 3 Dec 2012 04:35:45 +0000 (04:35 +0000)]
Merge "Make sure heat uses its own control_exchange"

12 years agoMake sure heat uses its own control_exchange
Steve Baker [Mon, 3 Dec 2012 04:26:34 +0000 (17:26 +1300)]
Make sure heat uses its own control_exchange

Due to this recent discussion
http://lists.openstack.org/pipermail/openstack-dev/2012-November/003578.html

And the commit message in this change
https://review.openstack.org/#/c/12518/

Change-Id: Icf7ee0475045a3d0a19b8d176162bd7286a39ddc

12 years agoMake default encryption key long enough for unit tests
Steve Baker [Mon, 3 Dec 2012 02:14:16 +0000 (15:14 +1300)]
Make default encryption key long enough for unit tests

Change-Id: Ibef2eabfa50b56c12975222d6073a243bcb0dfef

12 years agoMerge "Update the README with more current links"
Jenkins [Sun, 2 Dec 2012 23:15:05 +0000 (23:15 +0000)]
Merge "Update the README with more current links"

12 years agoUpdate the README with more current links
Angus Salkeld [Sun, 2 Dec 2012 23:08:29 +0000 (10:08 +1100)]
Update the README with more current links

Change-Id: I14cb327b75053f478b1a0bf1d463488601420390

12 years agoAdd VPC resource implementation
Steve Baker [Tue, 20 Nov 2012 03:27:20 +0000 (16:27 +1300)]
Add VPC resource implementation

This implements the AWS::EC2::VPC resource.

Change-Id: Ib50897d692292c42b21cffb7d8f6758f2d1a5f1f

12 years agoUpdate .gitreview for org move.
Jeremy Stanley [Sun, 2 Dec 2012 17:44:24 +0000 (17:44 +0000)]
Update .gitreview for org move.

* .gitreview: The heat project moved from the heat-api org to
openstack, so this updates the gerrit remote URL accordingly.

Change-Id: I17051b17e2f319ebd3df5e415a9a9742d5b6704e

12 years agoUse pkgutil to load cloudinit data
Zane Bitter [Tue, 27 Nov 2012 15:40:31 +0000 (16:40 +0100)]
Use pkgutil to load cloudinit data

Unlike reading from the filesystem, this will allow the data to be read
even if the package is installed as a gzipped tarball.

Change-Id: I1972f2b6a1b6cee12521480ed774468bb3444780
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoUse module names as logger names
Zane Bitter [Wed, 28 Nov 2012 14:19:35 +0000 (15:19 +0100)]
Use module names as logger names

Automatically use the current module's __name__ attribute as the name for
its logger, instead of hardcoding it or (worse) using __path__.

Change-Id: Ic089e0829e5fb93c3debd21e7715ee4c95f84d4c
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd a plugin directory for Resources
Zane Bitter [Fri, 30 Nov 2012 09:01:49 +0000 (10:01 +0100)]
Add a plugin directory for Resources

bug 1072903

Change-Id: I0f218c47620d50dc52bd931ee266f4dc19d701ed
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAutomatically register engine options
Zane Bitter [Fri, 30 Nov 2012 09:44:46 +0000 (10:44 +0100)]
Automatically register engine options

Register the engine options as soon as we import something from the engine
package. This means we do not need to explicitly do it in all of the unit
tests.

Change-Id: I8fb0c8665d0e0255521e21a6aac223ad1e3b1b25
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMove db crypto code out of the engine
Zane Bitter [Fri, 30 Nov 2012 15:35:22 +0000 (16:35 +0100)]
Move db crypto code out of the engine

Move it to heat.common instead, and change the module name to better
reflect what it does.

Change-Id: I14a8cdcea8e16607f10464e07fcab3da4f01fe10
Signed-off-by: Zane Bitter <zbitter@redhat.com>
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>