When detaching volume, the state of volume changed from 'in-use'
to 'detaching', and then from 'detaching' to 'available'.
The code used to ignore 'detaching' state by assuming the volume
has been detached when its state is not 'in-use' any more.
Now we take care 'detaching' state and raise error if detaching
failed.
Steve Baker [Fri, 19 Jul 2013 02:38:13 +0000 (14:38 +1200)]
Configure standalone pipelines for cfn and cloudwatch.
This allows waitconditions and cloud watch data to authenticate
using just the ec2token middleware. Stacks have been successfully launched
with a standalone heat onto an external grizzly openstack, including working
waitconditions and watch data.
This means that currently when in standalone mode, heat-cfn cannot
authenticate since it defaults to auth strategy keystone (and it appears
that auth strategy ec2 signing has not been implemented yet). This case
is sufficiently obscure that it most likely won't affect anyone at this
stage.
Steve Baker [Wed, 10 Jul 2013 03:05:53 +0000 (15:05 +1200)]
Put pre-created resources in state INIT COMPLETE.
Defines an INIT action, and make the resourse state
INIT COMPLETE before they are first created.
Calls to list resources will now include resource that have
not been created yet. This change allows resource topologies
to be displayed throughout the creation of the stack.
InstanceGroup explicitly supports "custom" versions of AWS::EC2::Instance
(instead of directly using heat.engine.resources.instance.Instance)
but there was no unit test for that feature. Here we add one.
Add missing parameters checking logic to Parameter validation. It
has to be optional, since template validation makes use of the same
Parameter validation code.
Joe Gordon [Fri, 12 Jul 2013 16:08:32 +0000 (17:08 +0100)]
Cleanup and make HACKING.rst DRYer
Reference the OpenStack hacking guide in HACKING.rst and remove
duplicate entries. Add placeholder section for heat specific
rules. heat specific rules can be created using hacking's local check
support.
This avoids registering multiple times the option if the registering
functions are called multiple path by different code paths. It's
necessary for the default configuration sample generator to have options
only registered once.
The update of oslo.notifier is needed to avoid it using the inexistant
$host option.
avoid excessive database calls while loading events
list_events constructs Event objects through Event.load, which causes
every event record previously loaded into memory to be reloaded again.
Furthermore, Event.load will also reload the associated stack, thus
all its resources and template. Another bad thing with that is
reloading a stack will lead to many extra stack static resolution
(including calls to nova to resovle Fn::GetAZs if it's referenced in
the template).
Steve Baker [Thu, 11 Jul 2013 04:08:54 +0000 (16:08 +1200)]
Global disable scheduler _sleep instead of mocking.
It is becoming increasingly difficult to predict when
a call to TaskRunner._sleep needs to be scripted, and is probably an
implementation detail which shouldn't be exposed to unit tests anyway.
This change defines a global which prevents sleeping in calls to _sleep
and toggles that global in HeatTestCase setUp.
Steve Baker [Tue, 9 Jul 2013 04:01:58 +0000 (16:01 +1200)]
Tolerate an empty environment properties.
An environment file containing the following:
properties:
Results in the following error:
File "/home/steveb/dev/localstack/heat/heat/api/openstack/v1/stacks.py",
line 132, in environment
env[self.PARAM_USER_PARAMS].update(parameters)
AttributeError: 'NoneType' object has no attribute 'update'
Steve Baker [Wed, 3 Jul 2013 03:21:23 +0000 (15:21 +1200)]
Define behaviour for properties with None values.
Now that Ref and Fn::GetAtt might return None values, behaviour for
properties with None values needs definition.
This change will treat a None value in the following way:
- if there is a default in the schema, that value will be used
- otherwise a default is used depending on the type ('', False, 0, [] {})
Steven Hardy [Wed, 3 Jul 2013 17:03:57 +0000 (18:03 +0100)]
engine : add suspend/resume support to watch resource
Add suspend/resume support to CloudWatchAlarm resource and
underlying watchrule - this means that when in suspended
state watches will not allow new metric data to be added
or for alarm evaluation/actions to happen
Stop patching the GenericResource's property_schema
This is causing test failures if you add a new test
and don't reset the scema to {}, this seems to be timing
related. Just add Resource types that we need prevents the
need for this patching.
Steve Baker [Wed, 3 Jul 2013 23:50:49 +0000 (11:50 +1200)]
Enforce credentials requirement on stack create/update.
Credentials need to be supplied whenever they are stored with the stack,
which is during stack create and update.
Some users have been relying on their auth token to perform all heat
operations (as all other openstack services support) however this has
led them to experience obscure errors when wait handles or alarms are
triggered.
Failing early with a clear error message will stop this class of errors.
Steven Hardy [Thu, 4 Jul 2013 09:26:31 +0000 (10:26 +0100)]
cleanup watchrule delete logic/tests
Rework watchrule delete interface so we delete by ID, rather than
by name (where we only delete the first rule in the event of multiple
watcherule rows with the same name, which is allowed although not likely
in normal heat operation - it can cause weird behavior in the tests)
Encapsulating the delete in a WatchRule.destroy() is cleaner and more
consistent with the rest of the codebase, and reworking the tests to
ensure proper cleanup reduces the chances of odd errors and cascading
failures between tests on failure.
We need to pass the id_list to the loadbalancer, otherwise it
can't lookup the instance IP adresses with nova and the loadbalancer
config ends up with 0.0.0.0 for every instance