]> review.fuel-infra Code Review - openstack-build/heat-build.git/log
openstack-build/heat-build.git
12 years agoMerge "Add more unit tests for the engine API"
Jenkins [Thu, 5 Jul 2012 16:53:06 +0000 (16:53 +0000)]
Merge "Add more unit tests for the engine API"

12 years agoMerge "Pass Tags into scheduler_hints"
Jenkins [Thu, 5 Jul 2012 14:18:35 +0000 (14:18 +0000)]
Merge "Pass Tags into scheduler_hints"

12 years agoAdd monitoring to the loadbalancer
Angus Salkeld [Thu, 5 Jul 2012 13:44:05 +0000 (23:44 +1000)]
Add monitoring to the loadbalancer

This makes use of haproxy's unix socket api
to get statistics. This is retrieved by cfn-push-stats
and posted to the watch.

Change-Id: I662293bf5dbc55e3f9106f7ef0ceb0641ddae564
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoMerge "heat tools : heat-db-drop prompt for missing password"
Jenkins [Thu, 5 Jul 2012 13:17:35 +0000 (13:17 +0000)]
Merge "heat tools : heat-db-drop prompt for missing password"

12 years agoAdd an OpenShift template.
Angus Salkeld [Thu, 5 Jul 2012 05:42:08 +0000 (15:42 +1000)]
Add an OpenShift template.

This is based off of http://www.krishnaraman.net/openshift-origin-on-openstack/

This is the broker, the node is TODO (but simpler).

Change-Id: I5d500a460e43de1172aa7636d9b94f590a979d97
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoPass Tags into scheduler_hints
Angus Salkeld [Thu, 5 Jul 2012 11:18:26 +0000 (21:18 +1000)]
Pass Tags into scheduler_hints

Change-Id: Idad6090c7baf0db943c999585dfe3bf33fc9492e
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoheat tools : heat-db-drop prompt for missing password
Steven Hardy [Thu, 5 Jul 2012 09:46:53 +0000 (10:46 +0100)]
heat tools : heat-db-drop prompt for missing password

heat-db-drop fails to drop databases when called via
tools/openstack erase, so prompt for password when
not passed as a CLI argument.

Change-Id: I4930b8457e0f3e1488187b35be9737578595c387
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat API : Convert API to use HeatAPIException subclasses
Steven Hardy [Wed, 4 Jul 2012 14:41:20 +0000 (15:41 +0100)]
heat API : Convert API to use HeatAPIException subclasses

Covert API to use HeatAPIException subclasses, instead of
plain webob exceptions, which cannot be correctly serialized
by the wsgi controller, and map engine errors to API exceptions
so the raw engine exception is not propogated to the user.
ref #125
fixes #150

Change-Id: I164c71e12ed29f40ad67188b645ca7ad2fa1fee8
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat API : Implement API specific exceptions
Steven Hardy [Wed, 4 Jul 2012 10:45:38 +0000 (11:45 +0100)]
heat API : Implement API specific exceptions

Implement HeatAPIException and subclasses, which will return error
responses serialized in the correct AWS API format when thrown
ref #125

Change-Id: I9039f181ee64ed59445667f50545dc6481973cb2
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat : add heat-boto test client
Steven Hardy [Fri, 29 Jun 2012 13:11:14 +0000 (14:11 +0100)]
heat : add heat-boto test client

Add initial version of the heat cli tool which uses boto
- revised following review comments to remove jeos/cfn paths
ref #92

Change-Id: I61b5815b250f3b01d33844ff46dd1612000d51fd
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoAdd more unit tests for the engine API
Zane Bitter [Wed, 4 Jul 2012 14:16:16 +0000 (16:16 +0200)]
Add more unit tests for the engine API

Verify the following endpoints:
 - list_stack_resources
 - describe_stack_resources
 - describe_stack_resource

Additionally, check for presence of the correct output keys from the
following endpoints:
 - list_stacks
 - show_stack

Note that some tests are commented out because they are currently failing.
This will be fixed in a future patch.

Change-Id: I1c8c46283c1217789e3d4dea7aeac11c991bcef4
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoStore the context in the resources
Zane Bitter [Tue, 3 Jul 2012 15:11:12 +0000 (17:11 +0200)]
Store the context in the resources

It's a pain to have to look it up in the stack every time

Change-Id: I655260aafd17bc17b5895f5b53d79b20aa8eecbb
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd Metadata to detailed Resource output
Zane Bitter [Tue, 3 Jul 2012 13:04:39 +0000 (15:04 +0200)]
Add Metadata to detailed Resource output

Change-Id: I492b9a0a190a905ca5c8597c7236ad1d130a5b77
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoUse a consistent stack ID
Zane Bitter [Tue, 3 Jul 2012 12:55:30 +0000 (14:55 +0200)]
Use a consistent stack ID

Generate the StackId field of various API responses in the same place, so
it is consistent and can be easily modified later.

Change-Id: I09a3e170b5825533d8cf9c7dbf08a0ef6700a682
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMake Stacks the owners of their own DB representation
Zane Bitter [Tue, 3 Jul 2012 11:02:03 +0000 (13:02 +0200)]
Make Stacks the owners of their own DB representation

Change the way that Stack objects are initialised, so that they know how to
load and store themselves in the database (they were already updating their
own data, but the actual creation was being done externally). This
consolidates a lot of existing Stack database creation code (in the
manager, nested stacks and unit tests) into one place.

Also, split the template and parameter handling out into separate classes,
and pass these through the constructor for easier testing.

Change-Id: I65bec175191713d0a4a6aa1d3d5442a1b64042f8
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoDon't store the metadata server address in the Stack
Zane Bitter [Tue, 3 Jul 2012 10:41:40 +0000 (12:41 +0200)]
Don't store the metadata server address in the Stack

It is basically a global piece of data, so there is nothing to be gained by
dragging some extra state around with us everywhere.

Change-Id: I50ba7391f258dc7d9b1e186f1618fb140e15b26e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoDelete user creds from DB when no longer required
Zane Bitter [Tue, 3 Jul 2012 10:32:02 +0000 (12:32 +0200)]
Delete user creds from DB when no longer required

The user credentials are only for a particular stack and should be deleted
when that stack is deleted.

Fixes #162.

Change-Id: Id5d1f101df17ede1843e4f2fca51903c956667ca
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRemove parsed template from database
Zane Bitter [Tue, 3 Jul 2012 12:03:47 +0000 (14:03 +0200)]
Remove parsed template from database

It is no longer used since we now store the parameters and can recreate the
parsed template from the raw template.

Change-Id: Id725bcde7b30ce33d122ccf9c6d5c571f7d754da
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMake LoadBalancer a subclass of a nested stack
Zane Bitter [Tue, 3 Jul 2012 16:56:22 +0000 (18:56 +0200)]
Make LoadBalancer a subclass of a nested stack

This avoids duplicating the code for dealing with the nested stack
instance.

Change-Id: Iaeb96f6184cc39677be81bb5619c1fc3e3c9a2a2
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoUse unittest assert*() methods instead of assert keyword
Zane Bitter [Tue, 3 Jul 2012 09:25:33 +0000 (11:25 +0200)]
Use unittest assert*() methods instead of assert keyword

This gives much more useful messages when something fails

Change-Id: Ibdf22996e674beef6edabfd3f7ef7d2213b6f26c
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoSwitch .gitreview to use OpenStack
Andrew Hutchings [Wed, 4 Jul 2012 12:27:45 +0000 (13:27 +0100)]
Switch .gitreview to use OpenStack

Change-Id: I47f98c5b68bffb0f547a1ca95e745dd2c4665dad

12 years agoAdd the loadbalancer resource.
Angus Salkeld [Tue, 3 Jul 2012 04:55:56 +0000 (14:55 +1000)]
Add the loadbalancer resource.

Some initial simplifications:
- only one Listener
- static (only use Instances)
- only http (no tcp or ssl)

Ref #164
Change-Id: Iaac06eff83a5c43049adc95a98ebe632e17b490c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoAdd the Fn::GetAZs() intrinsic function.
Angus Salkeld [Mon, 2 Jul 2012 03:10:59 +0000 (13:10 +1000)]
Add the Fn::GetAZs() intrinsic function.

This just returns 'nova' right now.

Change-Id: I5449123b912da0f2aaca8a16aee78d391db033dd
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoTeach CheckedSchema to do nested schemas
Angus Salkeld [Mon, 2 Jul 2012 01:23:32 +0000 (11:23 +1000)]
Teach CheckedSchema to do nested schemas

Change-Id: Ie321fcded8c826ca98c15078d9a545f283d25510
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoMerge "Bump to v5"
Jenkins [Mon, 2 Jul 2012 18:16:21 +0000 (18:16 +0000)]
Merge "Bump to v5"

12 years agoheat API : Add missing Response wrappers
Steven Hardy [Mon, 2 Jul 2012 13:04:33 +0000 (14:04 +0100)]
heat API : Add missing Response wrappers

It's not clear from the AWS API docs, but all responses
should be wrapped in ActionNameResponse tags.
ref #125

Change-Id: I25f3860f30b7313ce63019e96d1da4e370552ed6
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat API : Make CreateStack work with boto
Steven Hardy [Fri, 29 Jun 2012 12:08:47 +0000 (13:08 +0100)]
heat API : Make CreateStack work with boto

Further API rework to make stack creation work via boto
- Use webob.request.params not GET, as boto passes POST parameters in body
- Wrap CreateStack response in CreateStackResponse as expected by boto
- Add API debug for JSON format responses
- (second version in stackforge due to long-line fix)
ref #125

Change-Id: I347368ee0395a9019fae69a06e45260379ed7722
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoAdd unit tests for timeout extraction
Zane Bitter [Fri, 29 Jun 2012 08:52:41 +0000 (10:52 +0200)]
Add unit tests for timeout extraction

Change-Id: I87837b78dc04683aa686f0573bb7b643667c4553
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoheat API : DescribeStacks return all when no stack name specified
Steven Hardy [Mon, 25 Jun 2012 15:38:51 +0000 (16:38 +0100)]
heat API : DescribeStacks return all when no stack name specified

The AWS DescribeStacks API documentation says if no stack name specified,
we should return results for all stacks created.
fixes #142

Change-Id: I3d17fef7f1b660bf399e8ff82ff39ca2b2d6f046
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoFix typo in stack creation code
Zane Bitter [Fri, 29 Jun 2012 08:22:21 +0000 (10:22 +0200)]
Fix typo in stack creation code

Broken by b942be0e362ef6c04afb45f0ecae8fa4ce432a20

Change-Id: Iad6ace2d460212a41b8504d479335b9f16b5d5ce
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoChange oz rpm install to use yum
Jeff Peeler [Thu, 28 Jun 2012 03:35:32 +0000 (23:35 -0400)]
Change oz rpm install to use yum

yum localinstall will automatically download needed dependencies.

Change-Id: I0a24c549909ff50062affade014d3a17fc252e4d
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
12 years agoMerge changes I05dcfd9a,If938b51a,Iebd2693b
Jenkins [Thu, 28 Jun 2012 22:00:45 +0000 (22:00 +0000)]
Merge changes I05dcfd9a,If938b51a,Iebd2693b

* changes:
  Don't go fishing in the stack for the KeyName
  Tidy up create timeout code
  Get rid of _wrap_db_error()

12 years agoheat engine : Return timestamps formatted by heat_utils.strtime
Steven Hardy [Mon, 25 Jun 2012 16:42:15 +0000 (17:42 +0100)]
heat engine : Return timestamps formatted by heat_utils.strtime

Fix remaining timestamps which are not formatted via heat_utils.strtime
This allows event timestamps to be correctly parsed by boto.
ref #125

Change-Id: I62c3bdcdcfd8e1d51e6c3f2566eb1568e60097d2
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoClean up pip-requires for stackforge
Steven Dake [Thu, 28 Jun 2012 20:01:12 +0000 (13:01 -0700)]
Clean up pip-requires for stackforge

Change-Id: I50a79fedf80269b8b1bad2c94d132d6692c8ecae
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
Signed-off-by: Steven Dake <sdake@redhat.com>
12 years agoWe don't need to be installable via PIP so remove build and install deps
Steven Dake [Thu, 28 Jun 2012 18:36:50 +0000 (11:36 -0700)]
We don't need to be installable via PIP so remove build and install deps

setup.py is installing dependencies via pip, making a mess of the system.

Instead if someone wants to install, expect they will have openstack
installed already, which should contain the necessary dependencies.

Change-Id: I8ff82aad1b85bd4e1acc454b04c5fcec2adcadbe
Signed-off-by: Steven Dake <sdake@redhat.com>
12 years agoDon't go fishing in the stack for the KeyName
Zane Bitter [Wed, 27 Jun 2012 09:47:30 +0000 (11:47 +0200)]
Don't go fishing in the stack for the KeyName

The KeyName should be a property of the Instance, and need not have the
same name in the stack parameters.

Change-Id: I05dcfd9aa6f92bc7aaa2dbc594062984ac074b7e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoTidy up create timeout code
Zane Bitter [Tue, 26 Jun 2012 09:36:10 +0000 (11:36 +0200)]
Tidy up create timeout code

- Change the parameter name to 'TimeoutInMinutes' to match CloudFormation
- Don't hack parameters into the template, just pass them as parameters

Change-Id: If938b51a0fcb36bb76efeea3527ee7f8eaae9f81
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoGet rid of _wrap_db_error()
Zane Bitter [Mon, 25 Jun 2012 13:03:17 +0000 (15:03 +0200)]
Get rid of _wrap_db_error()

This was causing recursion depth errors, and the exceptions in question are
never being specifically caught anywhere anyway.

Fixes #137

Change-Id: Iebd2693bb1418392ebb041fbbb788bef28aae581
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoBump to v5
Ian Main [Wed, 27 Jun 2012 16:56:54 +0000 (09:56 -0700)]
Bump to v5

Heat version 4 is now released, on to version 5.

Change-Id: I6e679f0d202e25bcaa0620b2a858a2910f4d4f33
Signed-off-by: Ian Main <imain@redhat.com>
12 years agoStore the user parameters in the stack table
Angus Salkeld [Wed, 27 Jun 2012 05:20:45 +0000 (15:20 +1000)]
Store the user parameters in the stack table

This allows us to use the raw template + the parameters
in place of the parsed_template.
Using the parsed template we lose the dependancy information
that is necessary when deleting the stack.

Change-Id: Icc6ed9ae1617ea9f760a674b44630918669124f9
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoMerge "Do not remove qpid-cpp-server as it is part of openstack erase"
Jenkins [Tue, 26 Jun 2012 16:22:36 +0000 (16:22 +0000)]
Merge "Do not remove qpid-cpp-server as it is part of openstack erase"

12 years agoheat GettingStarted guide, add oz install instructions
Steven Hardy [Tue, 26 Jun 2012 15:41:17 +0000 (16:41 +0100)]
heat GettingStarted guide, add oz install instructions

Add F16/F17 install instructions for oz install
Amended following sdake review comments

Change-Id: I58830edd1581279ac987626b3fb4d7cc51fe455a
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoAdd nested templates that implement a simple proxy/loadbalancer
Angus Salkeld [Tue, 26 Jun 2012 13:23:27 +0000 (23:23 +1000)]
Add nested templates that implement a simple proxy/loadbalancer

Change-Id: I49f12e399f565d77955cf26288d182d0165422a0
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoPass the stack_id into the resource_metadata_update
Angus Salkeld [Tue, 26 Jun 2012 08:57:54 +0000 (18:57 +1000)]
Pass the stack_id into the resource_metadata_update

Change-Id: I2b98592cf3970e3cd79ae7002504fb34cf2d42cd
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
12 years agoDo not remove qpid-cpp-server as it is part of openstack erase
Steven Dake [Tue, 26 Jun 2012 06:11:51 +0000 (23:11 -0700)]
Do not remove qpid-cpp-server as it is part of openstack erase

qpid-cpp-server is not a core part of openstack proper

Change-Id: I448b19669c11c839c22b0c012d316b7b7bc75a69
Signed-off-by: Steven Dake <sdake@redhat.com>
12 years agoFew small fixes for getting started.
Ian Main [Tue, 26 Jun 2012 04:06:02 +0000 (21:06 -0700)]
Few small fixes for getting started.

A few small updates to the documentation and to the openstack install
script to make it work more smoothly from a base install.

Change-Id: Id9abad058695474aefcae62a5d7a1babc98d0ec9
Signed-off-by: Ian Main <imain@redhat.com>
12 years agoRemove --root=/ in install script
Jeff Peeler [Mon, 25 Jun 2012 22:04:25 +0000 (18:04 -0400)]
Remove --root=/ in install script

Installing with --root=/ put the files outside of the egg directory,
which is not desired.

Change-Id: I40142d1a67c0ee12814e08e7b2846bee0ce4e32e
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
12 years agoAdd keystone create script for devstack
Jeff Peeler [Mon, 25 Jun 2012 16:47:23 +0000 (12:47 -0400)]
Add keystone create script for devstack

Copied from heat-keystone-service, with two differences:
The keystone endpoint-create command has been deleted. Devstack uses the
templated catalog driver by default, which does not support this
command. (The equivalent operation is handled manually elsewhere.)

keystone user-role-add parameters have slightly different names,
requiring _id suffixes.

Change-Id: I3d56becde7b6fedbe29e1cfc6a2b4ad9ab2621fa
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
12 years agoheat API : Align DescribeStacks response with AWS docs
Steven Hardy [Mon, 25 Jun 2012 13:15:51 +0000 (14:15 +0100)]
heat API : Align DescribeStacks response with AWS docs

Reformat the DescribeStacks response to more closely align
with the AWS API spec - boto parses the result correctly with
these changes.  Ref #125

Change-Id: I23b270c040653f404014807de79c85b2ab63c85f
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat API : Escape JSON TemplateBody XML serialization
Steven Hardy [Mon, 25 Jun 2012 09:16:06 +0000 (10:16 +0100)]
heat API : Escape JSON TemplateBody XML serialization

AWS API defines JSON templates returned inside XML "wrapper"
this change escapes XML serialization of TemplateBody content
ref #152

Change-Id: I7e38dd2010b03061979f0906b582f9461c85cabc
Signed-off-by: Steven Hardy <shardy@redhat.com>
13 years agoMerge "Add uninstall script for Heat"
Jenkins [Sun, 24 Jun 2012 04:27:46 +0000 (04:27 +0000)]
Merge "Add uninstall script for Heat"

13 years agoMerge "Fix path to cloudinit directory"
Jenkins [Sun, 24 Jun 2012 04:25:38 +0000 (04:25 +0000)]
Merge "Fix path to cloudinit directory"

13 years agoAdd uninstall script for Heat
Jeff Peeler [Sun, 24 Jun 2012 02:41:30 +0000 (22:41 -0400)]
Add uninstall script for Heat

Change-Id: I1f0cbde19f5b75106d93cafdbd0b8fbf47cbbfe0
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
13 years agoFactor out authenticate method for engine.
Ian Main [Fri, 22 Jun 2012 15:48:23 +0000 (08:48 -0700)]
Factor out authenticate method for engine.

This patch factors out an authenticate() function for use by both
the heat service authentication and the resource authentication.
This fixes the AWS auth method for creating resources - issue #153.

Change-Id: I134e993263ae6ba4890f56bfbe6a6a3205b7f921
Signed-off-by: Ian Main <imain@redhat.com>
13 years agoFix metadata startup.
Ian Main [Fri, 22 Jun 2012 16:55:17 +0000 (09:55 -0700)]
Fix metadata startup.

A previous change to wsgi init caused the metadata to break.  This
makes the 4th argument to init optional allowing other wsgi apps to
continue to work as normal.

Change-Id: Ib0e7042f656a9319013dba4e30c7ffa35cb85f92
Signed-off-by: Ian Main <imain@redhat.com>
13 years agoChange install.sh to work on fresh install
Jeff Peeler [Fri, 22 Jun 2012 16:26:38 +0000 (12:26 -0400)]
Change install.sh to work on fresh install

Also, change shell to allow use of bash on Debian.

Change-Id: I53b038432389c824556d90ea686c28d132708904
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
13 years agoFix path to cloudinit directory
Zane Bitter [Fri, 22 Jun 2012 15:30:28 +0000 (17:30 +0200)]
Fix path to cloudinit directory

The various path manipulations designed to search for the cloudinit
directory do not work with the current installation script, or when
heat-jeos is also installed. They also perform gratuitous manipulation of
sys.path (causing warning messages) and may pick up the cloudinit files
from a different location to the code that is actually running. Python
already knows which heat package we are using - just look for the directory
inside there.

This patch also tidies up the code for generating the user data.

Change-Id: I14add5f1670aea2562329ff1a1303320a35ff428
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoMerge "heat API : Add support for ContentType=JSON query parameter"
Jenkins [Fri, 22 Jun 2012 11:05:24 +0000 (11:05 +0000)]
Merge "heat API : Add support for ContentType=JSON query parameter"

13 years agoIgnore the unimplemented properties of IAM::User
Angus Salkeld [Fri, 22 Jun 2012 04:41:20 +0000 (14:41 +1000)]
Ignore the unimplemented properties of IAM::User

They are in lots of templates, and this is going to get
irritating fast.

Change-Id: I42cb5e5d0e8496028a70d6bed8477a0c864a09e7
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoDon't use json.dumps() on the output of get_template
Angus Salkeld [Fri, 22 Jun 2012 04:11:01 +0000 (14:11 +1000)]
Don't use json.dumps() on the output of get_template

Change-Id: I913e9f9e2b90cd983fb9674b18b6c81d66129e6c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix EIP template.
Angus Salkeld [Fri, 22 Jun 2012 02:01:55 +0000 (12:01 +1000)]
Fix EIP template.

Some of the implemented flags were wrong.
Allow the eip to be deleted when no eip was created.

Change-Id: Id1d3aaff9adf0988a5c58f8bf0f7b2fb9c7bde44
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoRemove service name from nova() def
Steven Dake [Thu, 21 Jun 2012 22:05:00 +0000 (15:05 -0700)]
Remove service name from nova() def

The service_name field is not unique between distros or versions of
openstack, but is used to select endpoints for communication with nova
and volume services.  The nova client will sort out the correct operation
based upon the service_type field.

The service_name field should probably just be removed from the API
definition upstream.

Tested on F16 & Devstack U12.

Change-Id: I36409dba9d9ec2b453a027fc1e2e78f7c8ace2a2
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoheat API : Add support for ContentType=JSON query parameter
Steven Hardy [Thu, 21 Jun 2012 09:52:25 +0000 (10:52 +0100)]
heat API : Add support for ContentType=JSON query parameter

From reading the boto code, and looking at real AWS API responses
it would appear there is an (undocumented?) AWS query parameter
which switches response format from XML (default) to JSON
ref #125

Change-Id: I7c8b0f5701be5ff8bd0a3b135e42cf0e46e39ded
Signed-off-by: Steven Hardy <shardy@redhat.com>
13 years agoFix Stack initialisation
Zane Bitter [Thu, 21 Jun 2012 13:20:16 +0000 (15:20 +0200)]
Fix Stack initialisation

self.parms must be set before calling self.resolve_static_data()

Change-Id: Ic3864c56575d759f4f398eb55f90e12c2afdd5f6
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoheat templates : Cleanup README and template whitespace
Steven Hardy [Thu, 21 Jun 2012 13:03:19 +0000 (14:03 +0100)]
heat templates : Cleanup README and template whitespace

Align README with latest templates and cleanup some whitespace issues
ref #147

Change-Id: Iad39c388806bba6497f8abf0de46c04ef7ac7e69
Signed-off-by: Steven Hardy <shardy@redhat.com>
13 years agoFix the wait condition's reading of the metadata.
Angus Salkeld [Thu, 21 Jun 2012 10:10:53 +0000 (20:10 +1000)]
Fix the wait condition's reading of the metadata.

the db was caching the object, so we need to 'expire'
it to make sure we are getting live data.

Change-Id: I1108daccc96f3dcfa33fda968ea30d83e03aad2d
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix a typo (from the commit to use state instead of parsed_template)
Angus Salkeld [Thu, 21 Jun 2012 04:36:19 +0000 (14:36 +1000)]
Fix a typo (from the commit to use state instead of parsed_template)

Change-Id: I37800ad3fb50210b8f27ca889fcfa48e14da8af0
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoUse the correct resource name
Angus Salkeld [Thu, 21 Jun 2012 04:54:38 +0000 (14:54 +1000)]
Use the correct resource name

Change-Id: I25d6962dfcc75b703aae6489cd0e751317029bc6
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoMake the describe-resource API calls user-aware
Tomas Sedovic [Tue, 19 Jun 2012 12:54:27 +0000 (14:54 +0200)]
Make the describe-resource API calls user-aware

Fixes #143

The stack retrieval DB calls were already fixed in previous commits but
there was still one query (resource_get_by_physical_resource_id) that
would return any resource, not just the ones owned the user.

Change-Id: Ie02ff1e8ba6ea8da2c3d0c7f0a87c32452824fc6

13 years agoMerge "Don't remove resources from the DB during HA restart"
Jenkins [Wed, 20 Jun 2012 15:24:37 +0000 (15:24 +0000)]
Merge "Don't remove resources from the DB during HA restart"

13 years agoDB: add stack status & reason, resource metadata
Angus Salkeld [Wed, 20 Jun 2012 13:49:26 +0000 (23:49 +1000)]
DB: add stack status & reason, resource metadata

Change-Id: I369aa688fa9890a5484de417a9995e7f04f34ad2
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoUse the resource.state_description
Angus Salkeld [Wed, 20 Jun 2012 12:21:24 +0000 (22:21 +1000)]
Use the resource.state_description

Change-Id: I114067f3bb91c6d38b3c4c69af842f4f3585810b
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoDon't remove resources from the DB during HA restart
Zane Bitter [Wed, 20 Jun 2012 11:58:26 +0000 (13:58 +0200)]
Don't remove resources from the DB during HA restart

This was broken by 3b91d100a6c6424961e1ec06cf7afd9a1c9cf49c. Resources
should be removed from the DB only when the stack is deleted.

Change-Id: I6822aee8453afd6076793cff9206a035cff33588
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoMake the saving cfn-signaling more reliable
Angus Salkeld [Wed, 20 Jun 2012 11:24:44 +0000 (21:24 +1000)]
Make the saving cfn-signaling more reliable

1) The metadata saved in manager.py was not always showing up
   in the db (from wait_condition.py)
2) Reuse a little method in parser.py to retrieve the parsed_template
   db entry (and store the parsed_template_id).

Change-Id: Ib5b5474b81c0b7439eb1fa4aec5a0f1f21bbde1c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoRemove duplicate setup_logging()
Angus Salkeld [Wed, 20 Jun 2012 04:01:29 +0000 (14:01 +1000)]
Remove duplicate setup_logging()

This is already done in load_paste_app()

Fixes #146

Change-Id: I3631b7ade06c8b142960abbf9c172461fae93a56
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoWork around keystone strangeness (error deleting user)
Angus Salkeld [Wed, 20 Jun 2012 02:23:55 +0000 (12:23 +1000)]
Work around keystone strangeness (error deleting user)

Fixes: #144
Change-Id: Ib9298605accc3fc7d12112a4fb57df2b4746864a
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix db exception description
Angus Salkeld [Tue, 19 Jun 2012 23:37:23 +0000 (09:37 +1000)]
Fix db exception description

Change-Id: Ie7c1076e9cf5be1d6d63d3af7bc90933c1e588f7
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix the metadata rpc functions
Angus Salkeld [Tue, 19 Jun 2012 06:04:52 +0000 (16:04 +1000)]
Fix the metadata rpc functions

Change-Id: Id3a071a45037d85920d273fa198d59602443026d
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoMerge "heat API : Align response StackId with AWS spec"
Jenkins [Mon, 18 Jun 2012 17:34:50 +0000 (17:34 +0000)]
Merge "heat API : Align response StackId with AWS spec"

13 years agoheat API : Align response StackId with AWS spec
Steven Hardy [Mon, 18 Jun 2012 16:49:31 +0000 (17:49 +0100)]
heat API : Align response StackId with AWS spec

Revise response format for CreateStack, ListStacks and DescribeStacks
so the StackId element is formatted in a similar way to the AWS spec

Change-Id: I0dd34a6dae2e30c63619449ebbf89643ccc9d364
Signed-off-by: Steven Hardy <shardy@redhat.com>
13 years agoAdd more per-user stack support (2).
Ian Main [Mon, 18 Jun 2012 16:47:34 +0000 (09:47 -0700)]
Add more per-user stack support (2).

This finishes up the API calls with per-user returns of stacks and
events.

Change-Id: Iab6118f35978a6f62ad4d3454842cb7f3d686bc8
Signed-off-by: Ian Main <imain@redhat.com>
13 years agoMerge "Add execute bits to executable scripts manage.py and runner.py"
Jenkins [Mon, 18 Jun 2012 16:30:56 +0000 (16:30 +0000)]
Merge "Add execute bits to executable scripts manage.py and runner.py"

13 years agoAdd example templates for nested stacks
Zane Bitter [Mon, 18 Jun 2012 15:48:54 +0000 (17:48 +0200)]
Add example templates for nested stacks

Change-Id: I3b5fb7018a606895007dad589f1dcbeb6b0defe6
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoAdd execute bits to executable scripts manage.py and runner.py
Steven Dake [Mon, 18 Jun 2012 16:13:25 +0000 (09:13 -0700)]
Add execute bits to executable scripts manage.py and runner.py

Fixes issue #138.

Change-Id: I90b139dac5775cb061bed79e86e1ded99b9322ca
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoMerge "Add manpage for heat-metadata"
Jenkins [Mon, 18 Jun 2012 16:00:53 +0000 (16:00 +0000)]
Merge "Add manpage for heat-metadata"

13 years agoFix DB calls in Resource API
Zane Bitter [Mon, 18 Jun 2012 13:15:50 +0000 (15:15 +0200)]
Fix DB calls in Resource API

The DB API changed in 892b99bff480aba8240a1f49eadeea079bae4c81, while
these calls were added in 247cc2bb9afb9db87ffad7160ef05d2cc4457235. Both
patches were under review simultaneously.

Change-Id: I8fc6c3228c99f025e01fc82979fa94f086649909
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoAdd describe resource API calls
Tomas Sedovic [Thu, 14 Jun 2012 15:51:45 +0000 (17:51 +0200)]
Add describe resource API calls

Fixes #62.

This commit implements the `DescribeStackResource`,
`DescribeStackResources` and `ListStackResources` AWS API calls.

Change-Id: Id9161b3c3eb527d5936c5b8978e32a67ba6c12bb

13 years agoheat api/engine : Reworked approach to aligning with AWS date format
Steven Hardy [Mon, 18 Jun 2012 10:30:50 +0000 (11:30 +0100)]
heat api/engine : Reworked approach to aligning with AWS date format

Modifies heat internal default date-string representation to match AWS spec
Note heat.common.utils.strtime default format loses sub-second precision
Avoids having to regex mangle datetime string format
ref #125

Change-Id: I1347e82b1c3ccac5eac7c85858cf8009723547c2
Signed-off-by: Steven Hardy <shardy@redhat.com>
13 years agoheat API : Align time format with AWS spec
Steven Hardy [Sat, 16 Jun 2012 07:39:10 +0000 (08:39 +0100)]
heat API : Align time format with AWS spec

- Reformat ListStacks/DescribeStacks responses to align time format with AWS spec
- Remove duplicate member tags in DescribeStacks (now handled by XMLResponseSerializer)
ref #125

Change-Id: Ib001acba591dba52f3f56052427d2b298d781ea0
Signed-off-by: Steven Hardy <shardy@redhat.com>
13 years agoLengthen the timeout of the WaitCondition in the HA template
Angus Salkeld [Mon, 18 Jun 2012 05:10:30 +0000 (15:10 +1000)]
Lengthen the timeout of the WaitCondition in the HA template

Change-Id: I059075b80dfac0472ae2e2e47d14b2ee4093a530
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoChange create_watch_data from POST to PUT
Angus Salkeld [Mon, 18 Jun 2012 05:09:48 +0000 (15:09 +1000)]
Change create_watch_data from POST to PUT

Change-Id: Ie460e76668fdbc3101da183e373d02eefda945f3
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoGet the context from the db not the context of the guest tool
Angus Salkeld [Mon, 18 Jun 2012 05:09:08 +0000 (15:09 +1000)]
Get the context from the db not the context of the guest tool

Change-Id: Ia2403161a0f97eb1c807be339d8024ff5c245695
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoImplement Nested Stacks
Zane Bitter [Sun, 17 Jun 2012 14:05:58 +0000 (16:05 +0200)]
Implement Nested Stacks

Fixes #123.

Change-Id: I89affe471b4df898c7d3157ff23f9b64003c2893
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoMove parsing of parameters out of template parser
Zane Bitter [Sun, 17 Jun 2012 14:05:57 +0000 (16:05 +0200)]
Move parsing of parameters out of template parser

The format of the params received by the manager is a property of the Heat
API protocol, not of the template, so it makes sense not to have the parser
extracting the template parameter data from them. This simplifies the
implementation of #123 (Nested Stacks).

Change-Id: I8eaf50caf79f69359cbc8ee1f0193c08d7944d1c
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoGet stacks from the DB by either name or id
Zane Bitter [Sun, 17 Jun 2012 14:05:57 +0000 (16:05 +0200)]
Get stacks from the DB by either name or id

This code was previously misleading, as it appeared to get stacks by id,
but actually got them by name. This patch adds a separate API, so
get_stack() gets the stack by id and get_stack_by_name() gets it by name.

Change-Id: I1cbbb3f9211661ad665e208d87298f177825f8ac
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoMerge "Fix latest DB migration script"
Jenkins [Fri, 15 Jun 2012 22:44:08 +0000 (22:44 +0000)]
Merge "Fix latest DB migration script"

13 years agoLock to pep 1.1
Steven Dake [Fri, 15 Jun 2012 15:39:02 +0000 (08:39 -0700)]
Lock to pep 1.1

Change-Id: Ic363e8815c057219b2a7ba9dfc149d47378283e6
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoFix latest DB migration script
Zane Bitter [Fri, 15 Jun 2012 14:19:08 +0000 (16:19 +0200)]
Fix latest DB migration script

Unfortunately, as long as the user_creds_id column is not nullable the
script will still fail if there is data in the database. However with this
patch it is at least left in a recoverable state. Also, downgrades now
work.

Change-Id: Ibb7b7664ad2532154fab90a50bbb95ae9ccfbb91
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoRaise NotFound exceptions from database
Zane Bitter [Tue, 12 Jun 2012 14:23:35 +0000 (16:23 +0200)]
Raise NotFound exceptions from database

Raise a specific exception (NotFound) if something is not found in the
database. Then we can match on this exception, rather than searching the
error message (which effectively makes the text of error messages part of
the API).

Change-Id: I22673ffb1407cf95b1fe24eaec8824039c1dda4e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoTidy up Resource creation and deletion
Zane Bitter [Tue, 5 Jun 2012 07:46:10 +0000 (09:46 +0200)]
Tidy up Resource creation and deletion

Most of this code is common between resources, so put it in the parent
Resource class and have subclasses provide handle_create()/handle_delete()
methods for all their extra needs.

Change-Id: I14c6afa9fdd1ecc065036fa93bde2a693b6c3eb2
Signed-off-by: Zane Bitter <zbitter@redhat.com>