]> review.fuel-infra Code Review - openstack-build/heat-build.git/log
openstack-build/heat-build.git
12 years agoProvide more information with template URL error
Jeff Peeler [Mon, 19 Nov 2012 17:10:12 +0000 (12:10 -0500)]
Provide more information with template URL error

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

Fixes bug 1072951

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

Change-Id: Ide1d0a27337bfaf767cf85d59deef1752724fbcf

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

To get access to to_primitive()

Change-Id: I9a09609b5469870a217386be9fbad9261ef0c815

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

Change-Id: I4977a34b758f3dd2b5a4772dc074af2f0c715175

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

part of bug 1072896
Change-Id: I47011d14330f8d8015876a88529a399a1cee98b6

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

Nothing is using this.

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

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

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

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

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

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

This makes it easier to add tests for different controllers.

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

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

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

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

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

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

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

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

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

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

bug 1078779

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

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

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

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

Fixes bug 1078854

Change-Id: I3dae1502968853d563ba52bc1d6656c48d5d18ba

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Change-Id: I98c35a5d51c5c7d66e0b8a0fddc04f221d1d6ab7

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

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

Change-Id: I6fa92540dc3369b85d135232b10701937071cbd6

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

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

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

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

Change-Id: I2058616ce0191aab4d364b652f1b20d072f6b258

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

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

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

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

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

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

Change-Id: I501ebd403a241cc3b4a5c1e3070137cfc360bbda

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

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

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

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

Change-Id: Ib882bece911fcbc96fffab16a9f0e5ce3cb55fed

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

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

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

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

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

Change-Id: Iae30338b66912d660f1cf48119893b1ab593b67a

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

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

Change-Id: I98629c7f8fd9c391f58c16ae1f6f2a7a232a2802

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

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

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

Change-Id: I22519f8ae4278ad128d3785d090294285f3a1b89

12 years agoFix FnGetAtt id test
Steve Baker [Thu, 8 Nov 2012 02:41:25 +0000 (15:41 +1300)]
Fix FnGetAtt id test

12 years agoMerge "Fix cloud-init runcmd to be exec friendly"
Jenkins [Wed, 7 Nov 2012 21:18:54 +0000 (21:18 +0000)]
Merge "Fix cloud-init runcmd to be exec friendly"

12 years agoFix cloud-init runcmd to be exec friendly
Jeff Peeler [Wed, 7 Nov 2012 20:53:45 +0000 (15:53 -0500)]
Fix cloud-init runcmd to be exec friendly

Can't use colon builtin apparently, or you'll get this:
/var/lib/cloud/instance/scripts/runcmd: line 2:
 {setenforce 0 > /dev/null 2>&1 ||:: No such file or directory

Added cloud-init debug output to get the above, copied from:
http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config-chef.txt

Change-Id: I341cf73bc9a0f843d7ab8c99a9d15e1d514654e7
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
12 years agoReplace KeyStoneCreds params with X-Auth headers.
Steve Baker [Tue, 6 Nov 2012 23:59:56 +0000 (12:59 +1300)]
Replace KeyStoneCreds params with X-Auth headers.

Username/password are now in X-Auth-User, X-Auth-Key

12 years agoMerge "A template which associates an instance with a Quantum port."
Jenkins [Tue, 6 Nov 2012 22:57:06 +0000 (22:57 +0000)]
Merge "A template which associates an instance with a Quantum port."

12 years agoMerge "Type is now mandatory. Boolean now exists."
Jenkins [Tue, 6 Nov 2012 22:55:42 +0000 (22:55 +0000)]
Merge "Type is now mandatory. Boolean now exists."

12 years agoMerge "Make Boolean property a bool type. Since json has a native bool type, allow...
Jenkins [Tue, 6 Nov 2012 22:54:01 +0000 (22:54 +0000)]
Merge "Make Boolean property a bool type. Since json has a native bool type, allow bool or string as the property value. Validating a Boolean type value will now convert a string to a bool."

12 years agoMerge "Quantum template to demonstrate floatingip."
Jenkins [Tue, 6 Nov 2012 22:52:52 +0000 (22:52 +0000)]
Merge "Quantum template to demonstrate floatingip."

12 years agoMerge "Cleanup runcmd to exit 0 and not use 'type'"
Jenkins [Tue, 6 Nov 2012 15:44:34 +0000 (15:44 +0000)]
Merge "Cleanup runcmd to exit 0 and not use 'type'"

12 years agoQuantum template to demonstrate floatingip.
Steve Baker [Tue, 6 Nov 2012 02:40:38 +0000 (15:40 +1300)]
Quantum template to demonstrate floatingip.

12 years agoMake Boolean property a bool type.
Steve Baker [Tue, 6 Nov 2012 02:38:53 +0000 (15:38 +1300)]
Make Boolean property a bool type.
Since json has a native bool type, allow bool or string as the property value.
Validating a Boolean type value will now convert a string to a bool.

Change-Id: Ia1843e0f56e5afb2914708e42b62f2063279317f

12 years agoA template which associates an instance with a Quantum port.
Steve Baker [Mon, 5 Nov 2012 23:51:01 +0000 (12:51 +1300)]
A template which associates an instance with a Quantum port.

12 years agoType is now mandatory. Boolean now exists.
Steve Baker [Mon, 5 Nov 2012 23:49:48 +0000 (12:49 +1300)]
Type is now mandatory. Boolean now exists.

This is required for Quantum resource types to work with new Properties.

12 years agoHandle list properties that do not contain objects
Zane Bitter [Tue, 30 Oct 2012 20:50:00 +0000 (21:50 +0100)]
Handle list properties that do not contain objects

The previous implementation of schema verfication on properties required
that the schema for the contents of a property list always be a map. Now
this is specified explicitly, so that in theory a property could also be a
list of Strings or Integers.

Change-Id: Icdd9a6c9f9b1e884f959c74f0803b7f3bd2aecc4
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRemove the CheckedDict class
Zane Bitter [Mon, 5 Nov 2012 13:42:42 +0000 (14:42 +0100)]
Remove the CheckedDict class

Its functionality has been completely superceded by the new Properties
and Parameters implementations.

Change-Id: I33a1990ee543a189dd3ec8f22eec27e2b0514d09
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoUse new Parameters class in unit test
Zane Bitter [Mon, 5 Nov 2012 16:55:05 +0000 (17:55 +0100)]
Use new Parameters class in unit test

This test was still using the old CheckedDict implementation for
parameters.

Change-Id: I2ade5a81867d6b9f7517061e520da99575e8fbbd
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoGet rid of Resource.calculate_properties()
Zane Bitter [Mon, 5 Nov 2012 16:30:57 +0000 (17:30 +0100)]
Get rid of Resource.calculate_properties()

Use the new Properties class to lazily load property values so that we
always get the latest data, and get rid of the stateful hacks.

Change-Id: I02a1b927606da217d4adab1ca04b659abadda2ce
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd a Properties implementation with lazy loading
Zane Bitter [Mon, 5 Nov 2012 13:28:14 +0000 (14:28 +0100)]
Add a Properties implementation with lazy loading

This will allow property values to be calculated on demand, rather than
stored as state.

Change-Id: I93fefa911b96c931cbf48b82b5a7ccc13ad99168
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAvoid modifying the Properties of a Load Balancer
Zane Bitter [Mon, 5 Nov 2012 13:37:36 +0000 (14:37 +0100)]
Avoid modifying the Properties of a Load Balancer

Properties are defined by the template, and should not be modified. In this
case it was just as a convenience, since the value does not actually need
to be persisted beyond even the current call.

Change-Id: I6ca07989d246ec618b2ca5f051f8e614e24c81ae
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoFix schemata errors for properties
Zane Bitter [Mon, 5 Nov 2012 11:06:11 +0000 (12:06 +0100)]
Fix schemata errors for properties

In particular, Integer refers to a literal integer in the JSON markup:

  {"IntegerProperty": 42}

So use Number to refer to a string-encoded number:

  {"NumberProperty": "42"}

Change-Id: Id285ae6145ba888f59529207343d016fba3825eb
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoAdd a set of native quantum resource types.
Steve Baker [Mon, 29 Oct 2012 19:41:13 +0000 (08:41 +1300)]
Add a set of native quantum resource types.

The properties schemas map directly to the Quantum REST API, which makes
the implementation (and documentation) simpler.

The base class QuantumResource contains some default methods and
common utility functions.

templates/Quantum.template can be run without any parameters and only creates
network resources, no instances.

More example templates and tests will come later.

Change-Id: Ia270294440eeec5163e35009f6be0b5db9ad78c1

12 years agoRecursively replace all : with . in Output keys.
Steve Baker [Fri, 2 Nov 2012 04:07:47 +0000 (17:07 +1300)]
Recursively replace all : with . in Output keys.

This is needed so that some Quantum properties with colons in the keys are not
interpreted as xml namespaces.

Change-Id: Iba5290a408595b2f028744c10315daac29da055e

12 years agoMerge "Rename heat client to heat-cfn."
Jenkins [Sun, 4 Nov 2012 23:51:39 +0000 (23:51 +0000)]
Merge "Rename heat client to heat-cfn."

12 years agoRename heat client to heat-cfn.
Steve Baker [Sun, 4 Nov 2012 20:29:35 +0000 (09:29 +1300)]
Rename heat client to heat-cfn.

This is to allow python-heatclient to eventually become the default heat
client.

Documentation in heat.wiki will be updated to refer to heat-cfn when this
change is pushed.

Change-Id: I2209c36adf41fa5d0df0caf9200f7fedbdd51805

12 years agoUpdate openstack-common, add network_utils.
Steve Baker [Sun, 4 Nov 2012 22:05:04 +0000 (11:05 +1300)]
Update openstack-common, add network_utils.

This is required by impl_kombu.py. The engine failed to start without it.

12 years agoUse openstack-common service.py
Angus Salkeld [Fri, 2 Nov 2012 11:02:00 +0000 (22:02 +1100)]
Use openstack-common service.py

Change-Id: Idbc145209c039e9362cf97c9926e050f809ef0fa

12 years agoMerge "Add service.py from openstack-common"
Jenkins [Fri, 2 Nov 2012 09:47:52 +0000 (09:47 +0000)]
Merge "Add service.py from openstack-common"

12 years agoMerge "Update openstack-common"
Jenkins [Fri, 2 Nov 2012 09:47:33 +0000 (09:47 +0000)]
Merge "Update openstack-common"

12 years agoheat templates : Align AutoScaling template with cfntools
Steven Hardy [Fri, 2 Nov 2012 08:57:52 +0000 (08:57 +0000)]
heat templates : Align AutoScaling template with cfntools

Updated cfntools require authentication for cfn-push-stats,
so the AutoScaling template needs the user/key and boto.cfg
additions, same as in the HA templates, otherwise cfn-push-stats,
and hence autoscaling doesn't work

Change-Id: Ib3ef4a932bb656f29e25ef745409f5fe3e82c356
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoAdd service.py from openstack-common
Angus Salkeld [Thu, 1 Nov 2012 03:17:15 +0000 (14:17 +1100)]
Add service.py from openstack-common

Change-Id: Ia4996d89d0fdba6dbeb44ae4cf3ca202c78886ee

12 years agoUpdate openstack-common
Angus Salkeld [Thu, 1 Nov 2012 03:00:41 +0000 (14:00 +1100)]
Update openstack-common

Change-Id: I3abd011729f413dbd20806f54c9ae6963641d59a

12 years agoImplement NoEcho for parameters
Zane Bitter [Wed, 31 Oct 2012 19:18:43 +0000 (20:18 +0100)]
Implement NoEcho for parameters

Change-Id: I60ce651367479205e0d456e2ac0ec3f949766383
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoUse new Parameters class for validation
Zane Bitter [Wed, 31 Oct 2012 19:18:43 +0000 (20:18 +0100)]
Use new Parameters class for validation

The Stack.validate() method is no longer used for the validate_template
feature (since it requires the parameter values in order to parse the whole
template), so move the code for outputting parameter metadata to where it
is actually used.

Change-Id: Ibf2ad7cb485bff75953c952f34ea4a597ea5e2f8
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoSeparate Parameters implementation from Properties
Zane Bitter [Wed, 31 Oct 2012 19:18:43 +0000 (20:18 +0100)]
Separate Parameters implementation from Properties

There are only 3 types allowed for Parameters (String, Number and
CommaDelimitedList), but we are currently allowing more due to a shared
implementation with Properties (which is an internal implementation
detail). This creates a separate implementation for Parameters with only
the allowed types.

Change-Id: If51ec538893a582da2caa0356c25e515e9d8004e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoClean up hacks for parameter passing in unit tests
Zane Bitter [Wed, 31 Oct 2012 19:18:42 +0000 (20:18 +0100)]
Clean up hacks for parameter passing in unit tests

Don't rely on the internal behaviour of the Parameters class.

Change-Id: I14f11e6ead1c49cf540bba453200fdec7f2ce7a3
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoPut the Template class in its own file
Zane Bitter [Wed, 31 Oct 2012 19:18:42 +0000 (20:18 +0100)]
Put the Template class in its own file

Change-Id: I5e3a9ef79c1c4f893720cfa529066d49a7c83ad1
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoheat-keystone-setup : fix error on folsom first-install
Steven Hardy [Wed, 31 Oct 2012 16:28:19 +0000 (16:28 +0000)]
heat-keystone-setup : fix error on folsom first-install

When running heat-keystone-setup for the first time after (re)installing
openstack folsom, it fails, because the user-role-list is running *as* the
heat user, not reading the roles assigned to the heat user, which fails
because on a new install the heat user does not have the admin role.
Using the credentials from the environment means we run the command as
admin, but --user_id selects the roles for the heat user.

Change-Id: Ib2733e63f664d75be1e2e3bd43038bbd1dbebde8
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : add heat_waitcondition_server_url
Steven Hardy [Thu, 25 Oct 2012 13:50:28 +0000 (14:50 +0100)]
heat engine : add heat_waitcondition_server_url

Add config option for waitcondition server, since metadata
and waitcondition notifications are no longer handled by the
same API

Change-Id: Idc1b39c6c60b8473316fe4861f0f060568540b09
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat metadata : Remove all non-waitcondition related logic
Steven Hardy [Thu, 25 Oct 2012 13:40:47 +0000 (14:40 +0100)]
heat metadata : Remove all non-waitcondition related logic

Remove all logic except that required by cfn-signal, since both
cfn-hup and cfn-push-stats have been ported to use the CFN and
Cloudwatch APIs respectively

Change-Id: I087349ff3ab901c880a248bd124396a1383c0a5e
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat metadata : remove metadata_url logic
Steven Hardy [Thu, 25 Oct 2012 13:30:31 +0000 (14:30 +0100)]
heat metadata : remove metadata_url logic

Remove logic where the heat-metadata server registers a
URL on startup with the engine.  The instance metadata is
now served via the CFN api, so we just have a config-file
option specifying the URL of the CFN API.  We don't want to
preserve the "register on startup" logic, because we need the
engine to have access to this information even if it is
restarted independent of some other service (avoid reliance on
services coming up in a particular order)

Change-Id: I690170977227ec96451d2a2fd25f7e507370b604
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoMerge "Format stack_identity as id *and* links."
Jenkins [Fri, 26 Oct 2012 07:28:13 +0000 (07:28 +0000)]
Merge "Format stack_identity as id *and* links."

12 years agoFormat stack_identity as id *and* links.
Steve Baker [Thu, 25 Oct 2012 00:31:52 +0000 (13:31 +1300)]
Format stack_identity as id *and* links.

Here the id is defined as {stack_id}

Change-Id: Ieadda61d608e2d3e7125b42758cf80588178c042

12 years agoMove resources into a separate sub-package
Zane Bitter [Thu, 25 Oct 2012 18:44:20 +0000 (20:44 +0200)]
Move resources into a separate sub-package

Change-Id: I5a6d74949b6f39a9df6c5077c2ff768f50fb3ac1
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMove Timestamp code to separate file
Zane Bitter [Thu, 25 Oct 2012 20:18:27 +0000 (22:18 +0200)]
Move Timestamp code to separate file

Change-Id: I57627f5b9048bbbcda0a07ac274fd1e579348496
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoheat-keystone-setup : change role to heat_stack_user
Steven Hardy [Thu, 25 Oct 2012 13:04:49 +0000 (14:04 +0100)]
heat-keystone-setup : change role to heat_stack_user

Change heat_instance role name to heat_stack_user after discussions

Change-Id: I14e95df0e02d82566f4758510ae38f6b26ccb532
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : add template-defined users to keystone role
Steven Hardy [Thu, 25 Oct 2012 10:33:20 +0000 (11:33 +0100)]
heat engine : add template-defined users to keystone role

Add all keystone users created by the User resource type
to a special keystone role, which can be used later for
defining RBAC policy for these users, and also works around
a keystone bug (1060959) on Folsom

Fixes #279

Change-Id: I94931e427ed51f4332bcb506220925b7ce8097bc
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : Allow instance users to view their own details
Steven Hardy [Tue, 23 Oct 2012 20:59:38 +0000 (21:59 +0100)]
heat engine : Allow instance users to view their own details

So that cfn-hup can read instance metadata via the DescribeStackResource
API call, we need non-admin "instance users" to be allowed to read their
own AccessKey resource details (since it can-be/is referenced in the
instance resource metadata).  The change in this patch should allow non-admin
users to read *only their own* secret AccessKey, and leave existing admin-user
visibility of the AccessKey resources unchanged.

Change-Id: Ic26d614d8e30104fbb354a67d3376b5d995ae8cc
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat-keystone-setup add instance role
Steven Hardy [Thu, 25 Oct 2012 09:16:29 +0000 (10:16 +0100)]
heat-keystone-setup add instance role

Add "heat_instance" role which we will assign all "instance users"
to in the engine when we create them

Ref #279

Change-Id: If7cc07c605f7696c1e9f617dbfca1b81d5b04196
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat-keystone-setup workaround keystone arg syntax
Steven Hardy [Wed, 24 Oct 2012 12:48:22 +0000 (13:48 +0100)]
heat-keystone-setup workaround keystone arg syntax

Keystone user-role-add syntax is not the same on essex
and folsom, so try both formats so we can work with either
Removes potentially unreliable approach to detecting keystone
version, and also avoids error on folsom when the user already
has the specified role

Fixes #272

Change-Id: Iece52223a29069a1fd517018cc49613be6fac318
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat-keystone-setup workaround keystone output reordering
Steven Hardy [Wed, 24 Oct 2012 12:41:34 +0000 (13:41 +0100)]
heat-keystone-setup workaround keystone output reordering

Folsom version of keystoneclient orders the columns for
keystone user-list differently, so we need to detect the
new format to extract the correct field

Fixes #273

Change-Id: I46f653dd3a8f7b5a68648fbd72671f95b386a547
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat tests : StackBoto fix _check_*_result functions
Steven Hardy [Tue, 23 Oct 2012 13:20:37 +0000 (14:20 +0100)]
heat tests : StackBoto fix _check_*_result functions

The _check_*_result functions don't actually check anything
so make them check the response format, which should be a stackid

Change-Id: I6b22cdc64409846caadbd2ebca5e8a81eccc81a6
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat tests : refactor stackid check into utils.Stack
Steven Hardy [Tue, 23 Oct 2012 13:16:39 +0000 (14:16 +0100)]
heat tests : refactor stackid check into utils.Stack

Rework utils.Stack._check_stackid so it can be used in the
tests to verify stackid format, avoiding maintaining multiple
copies of a stackid regex

Change-Id: If7fbd7b35626c377b42a43ffa03ee8067540963b
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat tests : fix CFN_API_Actions test fix state reason
Steven Hardy [Tue, 23 Oct 2012 12:42:15 +0000 (13:42 +0100)]
heat tests : fix CFN_API_Actions test fix state reason

state reason is "state changed" not None now we commit
the IN_PROGRESS state transition to the DB

Change-Id: I4c6641cd489de13ee9575fcdf879cae95ad7df4d
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat tests : fix CFN_API_Actions test stackid regex
Steven Hardy [Tue, 23 Oct 2012 12:07:57 +0000 (13:07 +0100)]
heat tests : fix CFN_API_Actions test stackid regex

stackid format has changed since move from tenant name to
tenant id

Change-Id: I5e8304f33d49133bc1b7e5530ae1a8323e2986c5
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : kill running greenthreads on stack_delete
Steven Hardy [Thu, 18 Oct 2012 16:13:02 +0000 (17:13 +0100)]
heat engine : kill running greenthreads on stack_delete

Add logic to track running eventlet greenthreads and kill
them when we start a stack_delete.  This should avoid errors
where long-running greenthreads end up referencing stacks which
have subsequently been deleted.

Fixes #261
Ref #223

Change-Id: I0d10b6f2dad0efa1caec18a67a3cc66cc693ea24
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : Store all resource states to DB
Steven Hardy [Wed, 17 Oct 2012 13:38:08 +0000 (14:38 +0100)]
heat engine : Store all resource states to DB

Resources should be committed to the DB on transisiton
to CREATE_IN_PROGRESS state, otherwise resources
which take a long time to go from CREATE_IN_PROGRESS to
CREATE_COMPLETE (e.g WaitConditions) are invisible while
in the CREATE_IN_PROGRESS state to all except the thread
creating them.

Change-Id: If1563505e854c216c0f6a5ce84b613e1ccb74386
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoBump version to v8
Zane Bitter [Tue, 23 Oct 2012 09:49:47 +0000 (11:49 +0200)]
Bump version to v8

v7 has branched

Change-Id: Ib8d3471576e0d408b18f4ab4d04ffdeafba234b5
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoheat engine : Make Resource::swift handle auth_token
Steven Hardy [Mon, 22 Oct 2012 17:38:06 +0000 (18:38 +0100)]
heat engine : Make Resource::swift handle auth_token

Make Resource::swift() handle auth_token so the S3
resource will work with AWS auth

Fixes #271

Change-Id: Ie5aca026dea25045e42aab677a2c793c79de1658
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoCleanup runcmd to exit 0 and not use 'type'
Jeff Peeler [Fri, 19 Oct 2012 21:23:49 +0000 (17:23 -0400)]
Cleanup runcmd to exit 0 and not use 'type'

Change-Id: I37313a772839f56a015431bbb004ad767da0815e
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
12 years agoReST API: Add a keystone endpoint
Zane Bitter [Thu, 18 Oct 2012 13:50:27 +0000 (15:50 +0200)]
ReST API: Add a keystone endpoint

Change-Id: I2770279ec50822c106d3ae23ce2f736a49139443
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoHandle %(tenant_id)s in endpoints when updating
Zane Bitter [Thu, 18 Oct 2012 14:50:53 +0000 (16:50 +0200)]
Handle %(tenant_id)s in endpoints when updating

Change-Id: I61112f02b60b6bb63f33d5459edec1f44a49bdd5
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoChange the service user to match devstack
Zane Bitter [Mon, 22 Oct 2012 09:24:59 +0000 (11:24 +0200)]
Change the service user to match devstack

The user which authenticates keystone tokens should be the "heat" user in
the "service" tenant. This changes the default configuration to do this, as
devstack already does.

Ref #269

Change-Id: I89978ec0b490f6d404c568197dd4208097a4b695
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoPass the correct tenant for the service user
Zane Bitter [Mon, 22 Oct 2012 09:20:07 +0000 (11:20 +0200)]
Pass the correct tenant for the service user

Previously, the service user (which authenticates tokens passes to the
engine by the APIs) was paired with the tenant of the end user to do
authentication, which worked only when they were in the same tenant. This
should not be the case, since the service user should only have an admin
role in the "service" tenant.

Fixes #269

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