]> review.fuel-infra Code Review - openstack-build/heat-build.git/log
openstack-build/heat-build.git
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>
13 years agoDo proper dependency calculations
Zane Bitter [Thu, 14 Jun 2012 09:08:51 +0000 (11:08 +0200)]
Do proper dependency calculations

Change-Id: Ic8a9bd2105ebfff3604a45b45eac39da3b1bbcf5
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoheat manager : rename dict keys to align with AWS API
Steven Hardy [Thu, 14 Jun 2012 18:22:44 +0000 (19:22 +0100)]
heat manager : rename dict keys to align with AWS API

Rework to align API response format with AWS API XML key naming,
ref #125

Change-Id: Ifa0d1b87d0b721e71c50be06815a7aaf12b07bb3
Signed-off-by: Steven Hardy <shardy@redhat.com>
13 years agoAdd a better error message
Angus Salkeld [Fri, 15 Jun 2012 05:51:28 +0000 (15:51 +1000)]
Add a better error message

This was "ERROR" in the event status description.

Change-Id: I401bbbe1c8e8cafe64a692b7faba63bd2ab38a4c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAdd a user creds database table and associate stacks with username.
Ian Main [Fri, 15 Jun 2012 00:46:12 +0000 (17:46 -0700)]
Add a user creds database table and associate stacks with username.

This patch takes the credentials passed in from the context and allows
you to store them in the database in the 'user_creds' table for later
use with HA operations.  It also adds a 'username' to the stack table
for direct comparison and user validation to support per-user stacks.

Thanks to Angus for fixing the tests for me :)

Signed-off-by: Ian Main <imain@redhat.com>
13 years agoFix the metadata server auth (KeystoneCreds only sent from heat)
Angus Salkeld [Fri, 15 Jun 2012 00:55:51 +0000 (10:55 +1000)]
Fix the metadata server auth (KeystoneCreds only sent from heat)

Change-Id: I918ff76485649ec56312f7029895d61e0cbf7a4b
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix the error reporting.
Angus Salkeld [Thu, 14 Jun 2012 23:49:46 +0000 (09:49 +1000)]
Fix the error reporting.

- Don't return a dict error
- in manager return full response
- return the result in Resource.validate()

Change-Id: I585ea9dd9cf747927fb4effb90cfff49cba20931
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAdd manpage for heat-metadata
Tomas Sedovic [Mon, 11 Jun 2012 16:19:10 +0000 (18:19 +0200)]
Add manpage for heat-metadata

Fixes #140

Change-Id: Iafedefbf2e564760f560ca5f44a44b0cb943fede
Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
13 years agoheat API : return response body as XML not JSON
Steven Hardy [Wed, 13 Jun 2012 14:45:46 +0000 (15:45 +0100)]
heat API : return response body as XML not JSON

AWS API returns response as XML, this implements a new response serializer which
turns dicts returned from the engine into AWS style XML responses.  Ref #125.
Updated following review comment.

Change-Id: I8170ed814be0b5cea98761a2723e12be216374a3
Signed-off-by: Steven Hardy <shardy@redhat.com>
13 years agoAdd heat-db-setup.1 manual page
Steven Dake [Wed, 13 Jun 2012 19:50:01 +0000 (12:50 -0700)]
Add heat-db-setup.1 manual page

Change-Id: I80650931fd9d5de902e37458766d6938f6466bb3
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoPass Full Credentials to Engine
Ian Main [Tue, 12 Jun 2012 23:37:26 +0000 (16:37 -0700)]
Pass Full Credentials to Engine

In order to support HA operations, eg restarting an instance, we
need to have full credentials in the engine.  This patch passes
in the credential information into the engine and uses it to validate
the the user.  A future patch will have this information stored in
database and associated with each stack.  It also assigns the username
in the case of EC2 style authentication allowing us to support
per-user stacks with EC2 auth.

Change-Id: I4b92f83d4d10a2bfebd4ddedc8a4f53b3e1217fe
Signed-off-by: Ian Main <imain@redhat.com>
13 years agoImplement the user/access keys using keystone
Angus Salkeld [Wed, 13 Jun 2012 02:54:57 +0000 (12:54 +1000)]
Implement the user/access keys using keystone

Still no groups or policies

Change-Id: I3a78a62f741ed5979994b327e269fb9407bcebff
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAllow an already deleted watch to not fail the stack.delete().
Angus Salkeld [Tue, 12 Jun 2012 06:42:06 +0000 (16:42 +1000)]
Allow an already deleted watch to not fail the stack.delete().

Change-Id: I1fbf46475b901bb2cc3b85784444e547ab9d9e67
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoDelete redundant escalation_policy (rather use instance.restarter)
Angus Salkeld [Tue, 12 Jun 2012 04:34:41 +0000 (14:34 +1000)]
Delete redundant escalation_policy (rather use instance.restarter)

Change-Id: Ia5f6b6adfc5c8c60e1db5b2f4e0aa186d0437ad9
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoMake sure create happens if a resource has been deleted
Angus Salkeld [Tue, 12 Jun 2012 02:45:35 +0000 (12:45 +1000)]
Make sure create happens if a resource has been deleted

(recovery situation)

Change-Id: Ife4492bb32c4b1bbcedeba6e6bdd89bd952effcd
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoMake sure the 'nova_instance' is refreshed when ever the state changes
Angus Salkeld [Tue, 12 Jun 2012 02:58:34 +0000 (12:58 +1000)]
Make sure the 'nova_instance' is refreshed when ever the state changes

Change-Id: Ifadfb12bcd933ac66681fc94335c1ddd83fc31be
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoWhen restarting a resource make sure that the parsed_template_id is set
Angus Salkeld [Tue, 12 Jun 2012 02:35:04 +0000 (12:35 +1000)]
When restarting a resource make sure that the parsed_template_id is set

we need this to re-create resources else we get foreign key errors
from the db.

Change-Id: I41b142db020ae84026f3b7007ecd7d927a27880d
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix heat-jeos installation in Getting Started
Tomas Sedovic [Fri, 8 Jun 2012 09:36:49 +0000 (11:36 +0200)]
Fix heat-jeos installation in Getting Started

Change-Id: Idc6a3a7d5b541e03e99eba69fb91f0b069d789c0

13 years agoMake heat-keystone-service a tad more robust
Tomas Sedovic [Fri, 8 Jun 2012 09:24:04 +0000 (11:24 +0200)]
Make heat-keystone-service a tad more robust

The ADMIN_ROLE extraction failed when the column with the role names was
centered instead of left-aligned.

Change-Id: If39292b65dfce5fa820396e49e72fc635c2cb0c2

13 years agoAdd install.sh
Angus Salkeld [Fri, 8 Jun 2012 02:54:03 +0000 (12:54 +1000)]
Add install.sh

fixes #134

Change-Id: I5d0aa01143050a305c44573220e96dba9f81e1ae
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAdd EstimateTemplateCost API
Angus Salkeld [Fri, 8 Jun 2012 02:06:50 +0000 (12:06 +1000)]
Add EstimateTemplateCost API

see #1

Change-Id: Ib362b5320b5fa050dfb70202838042e222287534
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAdd the GetTemplate API
Angus Salkeld [Fri, 8 Jun 2012 01:35:56 +0000 (11:35 +1000)]
Add the GetTemplate API

see #1

Change-Id: I178a1d9a19570296b62381548434fb4fcf836fee
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoRemove cfntools and jeos
Steven Dake [Thu, 7 Jun 2012 14:47:47 +0000 (07:47 -0700)]
Remove cfntools and jeos

These files are now available in the heat-jeos repository.

Change-Id: I392e7443348a31e8454ae14d957b0b54560c2ec3
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoConvert getLogger(__file__) into getLogger('heat...')
Angus Salkeld [Thu, 7 Jun 2012 05:05:54 +0000 (15:05 +1000)]
Convert getLogger(__file__) into getLogger('heat...')

Makes a mess of logs when not installed.

Change-Id: Iab6bd247b943f276bf8de64aed65619b38f99acb
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAdd a Timeout (-t) to the heat options (and make -f for templates).
Angus Salkeld [Thu, 7 Jun 2012 01:41:03 +0000 (11:41 +1000)]
Add a Timeout (-t) to the heat options (and make -f for templates).

This makes the cli more consistent with AWS and implements
the timeout feature.

Note: the timeout is in minutes and defaults to 60 minutes.

Change-Id: I41dea75170c871c1ee47948643311752d9d5e41e
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix the setup of daemon config
Angus Salkeld [Wed, 6 Jun 2012 13:07:54 +0000 (23:07 +1000)]
Fix the setup of daemon config

Change-Id: I02d4a3da63d2438067cf64c15432d66b539c30bc
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoUpdate openstack-common
Angus Salkeld [Wed, 6 Jun 2012 05:15:15 +0000 (15:15 +1000)]
Update openstack-common

Change-Id: I5af06e0d44a69b9f968fce91db441157a69ea9c7
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoImprove parser readability + add unit tests
Zane Bitter [Tue, 5 Jun 2012 13:02:45 +0000 (15:02 +0200)]
Improve parser readability + add unit tests

Change-Id: I7dd8c394e6543d1ee545648af32c9025c522b6e0
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoFix parsing of metadata
Zane Bitter [Tue, 5 Jun 2012 10:07:37 +0000 (12:07 +0200)]
Fix parsing of metadata

I broke metadata in bece6593f00f8e096f045982673f85c67863b932 by no longer
updating the parsed template in the database. We need to resolve references
runtime data before storing the parsed template, because the metadata code
uses this directly.

Change-Id: I753fe199779ae1b0046366abadca0111a81463c6
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoRely on instance_id been set to None
Angus Salkeld [Tue, 5 Jun 2012 05:02:05 +0000 (15:02 +1000)]
Rely on instance_id been set to None

Then we can use the default FnGetRefId()

Change-Id: Ib328289b4d22cb7ab7b9985fa7c95cb19bcfd9c3
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agowait_condition: use properties not t['Properties']
Angus Salkeld [Tue, 5 Jun 2012 04:29:26 +0000 (14:29 +1000)]
wait_condition: use properties not t['Properties']

Change-Id: I81fc0dd654e9011fc7404f184390379edeacda8f
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix cloudwatch delete
Angus Salkeld [Mon, 4 Jun 2012 23:31:34 +0000 (09:31 +1000)]
Fix cloudwatch delete

Change-Id: I091bb394f5ad3afad82d55f4a81bdce94cc09b71
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix restart_resource()
Angus Salkeld [Tue, 5 Jun 2012 01:22:07 +0000 (11:22 +1000)]
Fix restart_resource()

Change-Id: Ia77c9a5ab4107d9803a6e8180fd9e34ac13436f5
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoPass the context to the db calls
Angus Salkeld [Tue, 5 Jun 2012 01:11:05 +0000 (11:11 +1000)]
Pass the context to the db calls

Change-Id: I38937ee37926507dab8a7ff9e0d0d42a3ada707d
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoadd user auth to ha template
Angus Salkeld [Mon, 4 Jun 2012 23:34:40 +0000 (09:34 +1000)]
add user auth to ha template

Change-Id: I044d153bc33de08c6736fd4dd32380ceb0bf8caa
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoMake sure the resource exists before trying to update it.
Angus Salkeld [Tue, 5 Jun 2012 00:57:08 +0000 (10:57 +1000)]
Make sure the resource exists before trying to update it.

Change-Id: I5d8bdc0f4ceff61cab0b909dcaaf8ab5952ba4af
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix the conversion from instance to resource name
Angus Salkeld [Tue, 5 Jun 2012 00:36:21 +0000 (10:36 +1000)]
Fix the conversion from instance to resource name

Change-Id: Iaca10eb5468bd7b64b6a66f87fc6f7066053cb27
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoRestructure watchrules to make them more testable
Angus Salkeld [Tue, 5 Jun 2012 00:04:16 +0000 (10:04 +1000)]
Restructure watchrules to make them more testable

Change-Id: Ic8085de3f5692249d82e68462bbed02da787712f
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAdd missing properties to cloud watch
Angus Salkeld [Sun, 3 Jun 2012 12:12:58 +0000 (22:12 +1000)]
Add missing properties to cloud watch

Change-Id: I8d4be61d1a0b7bd37c97148ca291d22487ee22ba
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoChange command interpreter to bash
Jeff Peeler [Mon, 4 Jun 2012 17:13:21 +0000 (13:13 -0400)]
Change command interpreter to bash

This is important since /bin/sh is symlinked to dash by default on
Debian based systems.

Change-Id: I47b6317981ec020bed0bc45f7f68b636d71023d6
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
13 years agoAdd qpid-cpp-server to the openstack setup script
Tomas Sedovic [Mon, 4 Jun 2012 14:44:20 +0000 (16:44 +0200)]
Add qpid-cpp-server to the openstack setup script

Change-Id: Ie63b1031583091b5bdfd52f79e59b841f21ee778

13 years agoTeach heat-api about the bind_host
Angus Salkeld [Mon, 4 Jun 2012 11:16:31 +0000 (21:16 +1000)]
Teach heat-api about the bind_host

Change-Id: Ica32693373a87f01c41755a2b041c187bddd034d
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoRefactor template resolution
Zane Bitter [Fri, 1 Jun 2012 08:50:15 +0000 (10:50 +0200)]
Refactor template resolution

Resolve functions in templates by making a copy of the data rather than
modifying the original. This means that e.g. a resource resolving functions
in its own template data does not result in changes to the data held by the
Stack.

This patch also refactors all of the template resolution methods to operate
using a common parsing algorithm to move through the tree.

Finally, the resources have been worked to load data as it is needed,
rather than requiring external code to put them into the correct state
before using them.

Change-Id: I79eafaefc9ced07b652fac7162aa2edbfa7f547a
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoU10 wordpress template
Steven Dake [Fri, 1 Jun 2012 20:55:54 +0000 (13:55 -0700)]
U10 wordpress template

Change-Id: I25beb7b48e287b3097379c1e1f92adc309ce9c83
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoMerge "Fix the Getting Started guide for the new setup.py"
Jenkins [Fri, 1 Jun 2012 19:18:32 +0000 (19:18 +0000)]
Merge "Fix the Getting Started guide for the new setup.py"

13 years agoFix new pep8 warnings.
Ian Main [Fri, 1 Jun 2012 18:50:36 +0000 (11:50 -0700)]
Fix new pep8 warnings.

With the new release of pep8 we have some different requirements.
This patch fixes them all.

Change-Id: Ief16becba47007460f8b125907b055aa51de999e
Signed-off-by: Ian Main <imain@redhat.com>
13 years agoFix the Getting Started guide for the new setup.py
Zane Bitter [Thu, 31 May 2012 14:09:35 +0000 (16:09 +0200)]
Fix the Getting Started guide for the new setup.py

With the new setup.py script, OpenStack must be installed before heat,
otherwise PIP will start importing bogus dependencies (at least on Fedora).

Also install stuff that was previously being installed by setup.py. This
will eventually be replaced with an install script (see #134).

Change-Id: I942def545f9351a1f3238dac49f34b13370e2597
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoRefactor Resource creation
Zane Bitter [Thu, 31 May 2012 09:17:30 +0000 (11:17 +0200)]
Refactor Resource creation

Allow the Resource class to instantiate the correct type of object for each
resource.

Change-Id: I518f27fa27f675b9e497aac40962331833077aed
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoClean up imports
Zane Bitter [Thu, 31 May 2012 09:17:30 +0000 (11:17 +0200)]
Clean up imports

Change-Id: Ibca9c8ab8b9dafb813baee6a9c4aa024bf9733e2
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoDon't use sys.exc_value
Zane Bitter [Thu, 31 May 2012 09:17:30 +0000 (11:17 +0200)]
Don't use sys.exc_value

sys.exc_value has been deprecated since Python 1.5, and is not thread-safe.
The replacement is sys.exc_info(), but in this case we don't need even that
since we have the exception in question available.

Change-Id: Ibb4b354fd099fbf0d6390163eb4f7cc9e97db0e9
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoGet list properties working again
Zane Bitter [Thu, 31 May 2012 09:17:30 +0000 (11:17 +0200)]
Get list properties working again

The CloudFormation documentation is very confusing on this point.
'CommaDelimitedList' is one of the data types that are valid for a
Parameter (the others are 'String' and 'Number'). A CommaDelimitedList
parameter takes the form of a string where the list members are delimted by
commas:

    "item1,item2,item3"

However the documentation also uses the phrase "Comma Delimited List" to
refer to the type of some Resource Properties that are, in fact, simply
lists:

    [ "item1" , "item2" , "item3" ]

...as if there were *another* way to represent lists. (Note that the
items here need not be strings, and in fact are usually objects of some
variety.)

So we need a different data type to represent the latter. (This patch
changes the name from 'TupleList' to just 'List', since the actual Python
sequence type is just an implementation detail.) In future, we should
probably also verify that only the 3 valid Parameter types are used, and
perhaps that list Properties contain only objects of the correct type.

Change-Id: I94054f588fc37f7d4ba245f2e92b86ac9c872c37
Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoRemove _authenticate() check for metadata calls (temp)
Angus Salkeld [Thu, 31 May 2012 04:25:59 +0000 (14:25 +1000)]
Remove _authenticate() check for metadata calls (temp)

To be replaced by proper AWS auth, which needs AWS::IAM::AccessKey
resource type to be hooked up.

Change-Id: Icbdb08493fb51add5e6d3d5f4a153595f93c8f75
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix the HA template (sed the username/password)
Angus Salkeld [Thu, 31 May 2012 00:48:35 +0000 (10:48 +1000)]
Fix the HA template (sed the username/password)

Change-Id: I835a9f6d2a9abfdeb5af8fb703c8abae5afae2d1
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix apt-get install
Steven Dake [Wed, 30 May 2012 21:49:27 +0000 (14:49 -0700)]
Fix apt-get install

rpm deps not available on ubuntu systems
fix apt-get install doesn't work (string vs list)

Change-Id: Ic2da1415f9bccb15321afd0ed5111041cbf2a2d0
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoRemove python 2.7ism
Steven Dake [Thu, 31 May 2012 03:06:23 +0000 (20:06 -0700)]
Remove python 2.7ism

Change-Id: I9e74d79e42cc22aa0f0883fb1e1582be2860d842
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoCompress qcow2 files to take up less disk space
Steven Dake [Wed, 30 May 2012 20:26:20 +0000 (13:26 -0700)]
Compress qcow2 files to take up less disk space

This results in less data transferred during a glance registration.

Change-Id: I36d17c6e1bf12e3e0f37394d5522c6f4f59313de
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoInstall argparse and update the U10 package cache
Steven Dake [Wed, 30 May 2012 18:15:34 +0000 (11:15 -0700)]
Install argparse and update the U10 package cache

cfntools require argparse
U10 package cache needs updating to install packages correctly

Change-Id: I3630f5082d4b9f73fa95805d51684a68bf8c0d6e
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoFix auth failed exception handler
Ian Main [Wed, 30 May 2012 17:46:15 +0000 (10:46 -0700)]
Fix auth failed exception handler

This patch fixes the auth failed exception handler so that we
get back a meaningful result when authentication fails.

Change-Id: I2f37daed3890fd685fa6f701938b675460e76b0c
Signed-off-by: Ian Main <imain@redhat.com>
13 years agoSet stack's `updated_at` time
Tomas Sedovic [Wed, 30 May 2012 14:52:17 +0000 (16:52 +0200)]
Set stack's `updated_at` time

Fixes #126

Change-Id: Ie7abe6c3385632138671cb0b7f12dfa33e69bae0

13 years agoAdd instance restarter
Angus Salkeld [Fri, 25 May 2012 01:53:57 +0000 (11:53 +1000)]
Add instance restarter

Change-Id: I8ef28efc7d86a1a3a44f4784cb496c415a14f95c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAdd a name to the checkeddict to improve the error messages
Angus Salkeld [Wed, 30 May 2012 03:10:02 +0000 (13:10 +1000)]
Add a name to the checkeddict to improve the error messages

Change-Id: I11edc3bce77cd84d0393d6d95c6733b7901f95a1
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAuthentication Overhaul
Ian Main [Tue, 29 May 2012 21:09:57 +0000 (14:09 -0700)]
Authentication Overhaul

This patch updates the authentication system set up in heat:

- We now authenticate against the 'heat' service at the entry
  point to each api call in the engine.
- We are now using the 'Context' class to contain the authentication
  information as intended.
- The two context classes are unified and we now use the same one
  for both WSGI and RPC.  This is the intended design as the
  context is loaded by the WSGI middleware and then passed into the
  RPC methods.
- We are now doing token authentication in the API that works with
  both native keystone and AWS style authentication.  That token is
  then passed on to the engine for further authentication for various
  endpoints.

Note that the heat-api-paste.ini file requires updating in order for
this to work on your system.  Admin user and password must be set
properly in the authtoken section in order to perform token based
authentication.

I suspect there will be a few bugs in here yet.  This is just part of
the authentication/identification changes we need to make but I wanted
to get this in so we could continue to work with a boto based client.

Change-Id: Ib635ecd3088304e8d51d8e1fc31a8b1bf751caf3
Signed-off-by: Ian Main <imain@redhat.com>
13 years agoMerge changes I31d97b0d,I10507113
Jenkins [Tue, 29 May 2012 21:40:06 +0000 (21:40 +0000)]
Merge changes I31d97b0d,I10507113

* changes:
  Changed SecurityGroups property type to TuplesList
  Change the policies for User to TuplesList

13 years agoMerge changes I475ac4f7,I212cffac
Jenkins [Tue, 29 May 2012 21:37:22 +0000 (21:37 +0000)]
Merge changes I475ac4f7,I212cffac

* changes:
  Add missing "properties_schema" to WaitConditionHandle
  Fix jeos_path when not intalled as an egg

13 years agoChanged SecurityGroups property type to TuplesList
Chris Alfonso [Tue, 29 May 2012 19:03:05 +0000 (15:03 -0400)]
Changed SecurityGroups property type to TuplesList

Change-Id: I31d97b0de6e72bd24f0f78d86890726fc1e8a138

13 years agoChange the policies for User to TuplesList
Chris Alfonso [Tue, 29 May 2012 15:08:02 +0000 (11:08 -0400)]
Change the policies for User to TuplesList

Change-Id: I105071135a6b20a414c2f4016ca3a8312a4ee2a2

13 years agoAdd missing flags to enable working with RabbitMQ
Jeff Peeler [Sat, 26 May 2012 18:16:19 +0000 (14:16 -0400)]
Add missing flags to enable working with RabbitMQ

Note: rpc_backend=heat.rpc.impl_kombu must be set in both heat-api.conf
and heat-engine.conf.

Change-Id: Ia7f5af8805240381f28ecae1efc0a677155f898e
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
13 years agocloudwatch: set HA template to send watch data
Tomas Sedovic [Wed, 23 May 2012 15:59:41 +0000 (17:59 +0200)]
cloudwatch: set HA template to send watch data

The Wordpress HA template is now able to utilize the cfn-push-stats and send
alarm messages to the metadata server.

Change-Id: I52b615d3401dc2665e2b30e4a925d61ed204c827
Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
13 years agoAdd the basic cloudwatch feature
Angus Salkeld [Fri, 25 May 2012 09:24:29 +0000 (19:24 +1000)]
Add the basic cloudwatch feature

Fix watch db tables and silly programming errors.
get basic posting data to metadata server working
add watch_rule_get_all()
check for alarms in a periodic task
delete watch_data when the rule is deleted
add a last_evaluated field to the watch_rule
remove unused option to watch_data_get
take better account of the sample period.
- still much to be done here (evaluation periods).
add some useful stats to cfn-push-stats
fix how the metric is accessed
fix a divide by zero

Change-Id: Iaf98499d0e3ac6d6f951ea38b3b0f409669258da
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAdd missing "properties_schema" to WaitConditionHandle
Angus Salkeld [Fri, 25 May 2012 02:12:14 +0000 (12:12 +1000)]
Add missing "properties_schema" to WaitConditionHandle

Change-Id: I475ac4f72613a2f20275949a01168246cae1fb52
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoFix jeos_path when not intalled as an egg
Angus Salkeld [Fri, 25 May 2012 01:51:21 +0000 (11:51 +1000)]
Fix jeos_path when not intalled as an egg

Also use os.path.join() to sort out trailing "/"

Change-Id: I212cffacc018f456894e9b7921fef75256edcf45
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoMerge "Changes to checkeddict for tuples and required"
Jenkins [Fri, 25 May 2012 00:29:15 +0000 (00:29 +0000)]
Merge "Changes to checkeddict for tuples and required"

13 years agoAllow login to U10 jeos launched from heat
Steven Dake [Fri, 25 May 2012 00:12:27 +0000 (17:12 -0700)]
Allow login to U10 jeos launched from heat

cloudinit on debian expects the user "ubuntu" - hard code to ec2-user
useradd doesn't create home directories on U10 without -m option

Change-Id: Iaaee6df560b60e203b17a36bba57ac410ad6ed56
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoChanges to checkeddict for tuples and required
Chris Alfonso [Thu, 24 May 2012 19:22:41 +0000 (15:22 -0400)]
Changes to checkeddict for tuples and required

13 years agoMake i386 cfntools jeos work
Steven Dake [Thu, 24 May 2012 01:24:57 +0000 (18:24 -0700)]
Make i386 cfntools jeos work

was expectin cfg-* instead of cfn-*

Change-Id: I6234829d92a33e8bd4a8fab246ded2c1a43afc55
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoAdd U10 JEOS support to heat jeos_create
Steven Dake [Wed, 23 May 2012 23:09:00 +0000 (16:09 -0700)]
Add U10 JEOS support to heat jeos_create

This requires oz 0.9.0 (or latest master).  0.8.0 shipped with
most distros does not have customization support for Ubuntu
images.

fixes issue #23

Change-Id: I854aaf9657353b3fdb4768a277b527304e88ac8e
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoValidate all resource properties
Angus Salkeld [Thu, 24 May 2012 11:01:46 +0000 (21:01 +1000)]
Validate all resource properties

Change-Id: Ib0346fd22636d3eae31c688426b966f07acda19c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
13 years agoAdd functional test to verify jeos and stack ops
Jeff Peeler [Wed, 23 May 2012 20:13:00 +0000 (16:13 -0400)]
Add functional test to verify jeos and stack ops

(Tox.ini has been modified to only run tests tagged with 'unit'
to prevent this test from running with unit tests.)

This test requires an OpenStack install present and will not run on
StackForge. This test creates a JEOS, waits for glance registration,
detects key registered with keystone, creates stack, and verifies over
SSH that:
- cfn helper script SHAs match tree
- verifies presence of wordpress
- verifies expected user data is present in multipart mime file

closes #112

Change-Id: I22a0dfe41986d466ac689c050fc33585e3e6229e
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
13 years agoFixing variable name for debug message
Chris Alfonso [Wed, 23 May 2012 20:19:33 +0000 (16:19 -0400)]
Fixing variable name for debug message

Change-Id: I5992e0c449b5caeff3fd91c3aefe721ab32830c4

13 years agousing the calculated path for the template tests
Chris Alfonso [Wed, 23 May 2012 19:37:07 +0000 (15:37 -0400)]
using the calculated path for the template tests

Change-Id: Ifc5f142cf36a387d32f2ea70dfcb1bb33a44a056

13 years agoUpdate resource statuses in the database
Zane Bitter [Wed, 23 May 2012 18:34:54 +0000 (20:34 +0200)]
Update resource statuses in the database

This ensures that resources will not get deleted multiple times when
something else fails during stack deletion.

Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoFix deletion of security groups
Zane Bitter [Wed, 23 May 2012 17:14:39 +0000 (19:14 +0200)]
Fix deletion of security groups

First off, don't set the instance_id to an empty string as soon as we
retrieve the object from the database.

Also, don't fail if we try to delete a security group that no longer
exists.

Signed-off-by: Zane Bitter <zbitter@redhat.com>
13 years agoOnly run cfn-init once
Steven Dake [Wed, 23 May 2012 14:42:19 +0000 (07:42 -0700)]
Only run cfn-init once

cloud-config-final.service (atleast in Fedora 16) runs the user scripts.  So
there is no need to run them in cloud-config.service (which this file is processed
by).

May need a revisit on deb based systems.

Change-Id: Ib7c3d56a50bcdc4ea68626e1d57a28a4ec70e1b4
Signed-off-by: Steven Dake <sdake@redhat.com>
13 years agoUse the new CheckedDict for Parameters
Angus Salkeld [Wed, 23 May 2012 12:15:38 +0000 (22:15 +1000)]
Use the new CheckedDict for Parameters

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>