]> review.fuel-infra Code Review - openstack-build/heat-build.git/log
openstack-build/heat-build.git
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>
12 years agoMerge "ReST API: Format output as JSON"
Jenkins [Fri, 19 Oct 2012 20:45:14 +0000 (20:45 +0000)]
Merge "ReST API: Format output as JSON"

12 years agoMerge "Start and enable libvirtd."
Jenkins [Fri, 19 Oct 2012 18:37:58 +0000 (18:37 +0000)]
Merge "Start and enable libvirtd."

12 years agoStart and enable libvirtd.
Ian Main [Fri, 19 Oct 2012 18:30:27 +0000 (11:30 -0700)]
Start and enable libvirtd.

Just did a fresh install on fedora 17 and found libvirt was not running
by default which caused nova to not start.  Explicitly enable it.

Change-Id: Id244af934007020d1a9f263dd71f04e5950dd2c5
Signed-off-by: Ian Main <imain@redhat.com>
12 years agoheat engine : Resource.keystone handle auth_token
Steven Hardy [Fri, 19 Oct 2012 18:11:51 +0000 (19:11 +0100)]
heat engine : Resource.keystone handle auth_token

Handle auth_token as well as username/password

Fixes #268

Change-Id: I7015556d74e026977fdd04f4ce9a378c0fac7695
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : Rework auth.authenticate
Steven Hardy [Fri, 19 Oct 2012 18:02:33 +0000 (19:02 +0100)]
heat engine : Rework auth.authenticate

engine.auth.authenticate is really creating a novaclient
connection, so move this into Resource.nova

Ref #268

Change-Id: I15d9c0537b3af9e65cd1ea5bd667bde0c89dc4c2
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat engine : remove unused EC2 style auth from engine
Steven Hardy [Fri, 19 Oct 2012 15:12:15 +0000 (16:12 +0100)]
heat engine : remove unused EC2 style auth from engine

We handle EC2 style auth at the heat-api-cfn level, so EC2
style authenticated requests simply pass us an auth_token in
the context, so remove this duplicate/dead code.

Ref #268

Change-Id: I17708cb6ef4b0eb4989d47c116b6211f0d419dcb
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoReST API: Format output as JSON
Zane Bitter [Fri, 19 Oct 2012 15:14:12 +0000 (17:14 +0200)]
ReST API: Format output as JSON

Eventually, both XML and JSON will be supported, but for now make the
output JSON, the same as the input.

Change-Id: If0f00b182c27616a9a6f08b468d732c718b7635a
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoDo not assume host has selinux utils installed
Jeff Peeler [Fri, 19 Oct 2012 15:20:04 +0000 (11:20 -0400)]
Do not assume host has selinux utils installed

related to #265

Change-Id: I4a6cff1f05b6f4f88d672cc0d4ce5e8f62a58e47
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
12 years agoIdentify stacks using tenant UUIDs
Zane Bitter [Fri, 19 Oct 2012 14:15:13 +0000 (16:15 +0200)]
Identify stacks using tenant UUIDs

Tenant names may come and go, but UUIDs are universally unique. Therefore,
ownership of the stack should be keyed on the tenant_id, not the tenant
name.

Change-Id: I7ec410aeaeceb6319299935b5f34d7c4e9c63d67
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMake default distribution U10 for deb template
Jeff Peeler [Thu, 18 Oct 2012 18:53:26 +0000 (14:53 -0400)]
Make default distribution U10 for deb template

Change-Id: Ifcfc7d1fbb6fac2a785a0dc5a4e6ba09cf898ed4
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
12 years agoheat engine : Make wait-condition poll interval better
Steven Hardy [Wed, 17 Oct 2012 12:37:57 +0000 (13:37 +0100)]
heat engine : Make wait-condition poll interval better

Remove rising-rate sleep-time logic and replace with a bounded
poll interval derived from the timeout - this should avoid ramping
up to a really long interval and delaying stack complete status

Fixes #264

Change-Id: Id53b87a988299708c29fc853f2801f527fd825dd
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoHandle upgrades in heat-keystone-setup
Zane Bitter [Tue, 16 Oct 2012 14:31:59 +0000 (16:31 +0200)]
Handle upgrades in heat-keystone-setup

Handle upgrades of Heat by removing any outdated endpoints that exist in
keystone and adding any existing "heat" service user to an admin role in
the service tenant.

Change-Id: If6393417b5404a56b4723f42fb1a1b394d01cc6a
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoRename CloudFormation service to heat-cfn
Zane Bitter [Wed, 17 Oct 2012 08:33:45 +0000 (10:33 +0200)]
Rename CloudFormation service to heat-cfn

This is consistent with what is implemented in devstack.

Change-Id: If47c28ddbef1d6c61e2d741f359d850e4ecffaa9
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMerge "heat tests : Remove utils.Stack getter methods"
Jenkins [Wed, 17 Oct 2012 08:33:13 +0000 (08:33 +0000)]
Merge "heat tests : Remove utils.Stack getter methods"

12 years agoheat tests : Remove utils.Stack getter methods
Steven Hardy [Tue, 16 Oct 2012 16:24:53 +0000 (17:24 +0100)]
heat tests : Remove utils.Stack getter methods

Remove the get_*_client getter methods, as they aren't
actually doing anything, so just access the attributes

Change-Id: Ic6740bdfe7d44c40b9fdf9fc4d03f8eddaf9a740
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoUse password in preference to token if both supplied
Zane Bitter [Tue, 16 Oct 2012 14:33:55 +0000 (16:33 +0200)]
Use password in preference to token if both supplied

Fixes #263 - devstack is providing a token in the environment, which was
causing the wrong path to get hit.

Change-Id: I9aae346e57fdfe156e52d4696e8f2f859884ff2f
Signed-off-by: Zane Bitter <zbitter@redhat.com>
12 years agoMerge "heat : heat cli pep cleanups"
Jenkins [Tue, 16 Oct 2012 14:16:50 +0000 (14:16 +0000)]
Merge "heat : heat cli pep cleanups"

12 years agoheat tests : add ValidateTemplate test to CFN_API_Actions_Boto test
Steven Hardy [Tue, 16 Oct 2012 13:16:17 +0000 (14:16 +0100)]
heat tests : add ValidateTemplate test to CFN_API_Actions_Boto test

Add test for ValidateTemplate test to test_CFN_API_Actions_Boto.py

Change-Id: I1fff55cd9aaa0c62c2a1e05050695bcd3f96664a
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat tests : Add ValidateTemplate test to CFN_API_Actions test
Steven Hardy [Tue, 16 Oct 2012 12:45:24 +0000 (13:45 +0100)]
heat tests : Add ValidateTemplate test to CFN_API_Actions test

Add test for ValidateTemplate action to test_CFN_API_Actions.py

Change-Id: Ia7a377f952d096e7b728a7151906ab2781695008
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat API : ValidateTemplate fix response format
Steven Hardy [Tue, 16 Oct 2012 12:19:27 +0000 (13:19 +0100)]
heat API : ValidateTemplate fix response format

Fix CFN API ValidateTemplate response format, missing the
ValidateTemplateResponse wrapper, required by boto to parse the response

Change-Id: I89464df402346ff87041496652d2b4d39cc35fc6
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat : heat cli pep cleanups
Steven Hardy [Tue, 16 Oct 2012 13:34:38 +0000 (14:34 +0100)]
heat : heat cli pep cleanups

Fix some pep whitespace issues, which were not picked
up by the jenkins gate for some reason..

Change-Id: I9a3488d61a3cde4bb8038f3f1927eb0c1ad0f60c
Signed-off-by: Steven Hardy <shardy@redhat.com>
12 years agoheat : boto_client_cloudwatch allow credentials override
Steven Hardy [Mon, 8 Oct 2012 12:48:27 +0000 (13:48 +0100)]
heat : boto_client_cloudwatch allow credentials override

Allow the AWS key/secret to be passed in when making the client
connection like boto_client.py

Ref #222

Change-Id: Iee24120eb52c8ffb97b1b421b0a27313e5f5cbdd
Signed-off-by: Steven Hardy <shardy@redhat.com>