Steve Baker [Fri, 8 Mar 2013 00:06:04 +0000 (13:06 +1300)]
Add tests to validate REST path to action mapping.
The Routes mapping performs some brittle regexp manipulation
to build the parameter mapping on the path, so its nice to validate
that it is doing what is expected.
Steven Hardy [Thu, 7 Mar 2013 11:14:45 +0000 (11:14 +0000)]
heat common : quieten policy logging
Policy logs the currently loaded policy for every request, which is
too noisy even for debug - we already log the file which contains
the policy when we load it, so this is probably sufficient.
Steven Hardy [Thu, 7 Mar 2013 12:08:08 +0000 (12:08 +0000)]
heat common : BaseClient respect host argument
Currently the BaseClient class ignores any host argument and overwrites
it with the host from the keystone catalog URL, we should respect the
host parameter if it is passed, but make it optional
Currently if properties.validate() fails causing the resource
to go to CREATE_FAILED state, we get an error when creating
the event, because the bad properties are evaluated in the event
constructor. Instead create a dummy Error property with the
error string for the event.
Steven Hardy [Tue, 5 Mar 2013 15:46:08 +0000 (15:46 +0000)]
heat tests : move GenericResource into tests directory
The resource.py GenericResource type is only used in tests, so
move it into the tests area, such that it can't accidentally be
used in the main heat codebase when we fail to import any resource
plugins..
Steven Hardy [Wed, 6 Mar 2013 14:55:12 +0000 (14:55 +0000)]
heat engine : watchrule quietly discard unused metric data
Some cfn-push-stats options try to send multiple metrics to a
watch, which won't work with our simplified CW implementation
which expects exactly one Metric associated with each watch
(since that's all you can define via the template)
So quietly discard any metric data we aren't interested in.
Steven Hardy [Wed, 6 Mar 2013 14:14:53 +0000 (14:14 +0000)]
heat engine : Loadbalancer template watch reference should be Ref
Replace hard-coded reference to latency_watcher with Ref, otherwise
the name is not fully qualified for the nested stack and the engine
fails to lookup the watchrule
Angus Salkeld [Wed, 6 Mar 2013 05:28:00 +0000 (16:28 +1100)]
make parsed template snapshots before updating
This is to make sure that as the update progresses and dependant
resources are modified/replaced that we compare the original
dynamic data with the current.
Steve Baker [Wed, 6 Mar 2013 02:29:12 +0000 (15:29 +1300)]
Allow instance NetworkInterfaces to be list of str or dict
It should be possible to specify NetworkInterfaces of an instance either
as an array of strings or as an array of dicts.
The following should now be possible:
This will define nics in the order specified by DeviceIndex
"NetworkInterfaces" : [
{ "NetworkInterfaceId" : {"Ref" : "controlXface"}, "DeviceIndex" : "0" },
{ "NetworkInterfaceId" : {"Ref" : "controlXface2"}, "DeviceIndex" : "1" },
],
This will define nics in the order specified by list position
"NetworkInterfaces" : [{"Ref" : "controlXface"}, {"Ref" : "controlXface2"}],
Mixing the 2 forms is supported but the resulting order is not defined.
Amazon documentation is ambigious about which form is actually supported
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-networkinterfaces
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2.html#cfn-template-snippets-eni Fixes: Bug #1096013
Change-Id: Id387d2e750cbe533a9b8a1fedc49d5bcf690fbcf
Steven Dake [Tue, 5 Mar 2013 16:01:56 +0000 (09:01 -0700)]
Stop heat services from logging to stderr by default
Change the configuration files to set use_stderr to False by
default. Oslo's log sets use_stderr to True by default, and
the only reasonable way to override is via the config files.
Steven Hardy [Mon, 4 Mar 2013 15:29:36 +0000 (15:29 +0000)]
heat clients : Make heat-boto rollback disabled by default
The boto library always sends the DisableRollback parameter,
defaulted to False, which is the opposite of the engine
default now, so we have to set DisableRollback to True in
the boto client wrapper
Steven Hardy [Mon, 4 Mar 2013 15:27:57 +0000 (15:27 +0000)]
heat clients : Change --disable-rollback to --enable-rollback
Since the engine default is now rollback disabled, flip this
switch so the user can opt-in to rollback functionality via
the --enable-rollback cli option to heat-cfn/heat-boto
Angus Salkeld [Mon, 4 Mar 2013 06:00:47 +0000 (17:00 +1100)]
Use oslo logging setup.
The one reason we kept our own version was because of the qpid
logging that is quite useful. But this is now easily done via
the "default_log_levels" option.
I have setup the api servers with:
ampqlib,qpid.messaging,keystone,eventlet
and the engine with:
ampqlib,qpid.messaging,keystone,eventlet,sqlalchemy
Zane Bitter [Fri, 1 Mar 2013 14:24:19 +0000 (15:24 +0100)]
Fix flaky unit test
This was failing intermittently during the gate tests because there was no
dependency in the template for the Instance on the WaitConditionHandle, nor
for the WaitCondition on the Instance, so the order in which resources
would be created was somewhat random.
This patch fixes the test template, and tests updating the metadata should
occur *during* creation of the stack, as well after, to replicate a real
wait condition (which won't finish creation until the metadata update
occurs).
Steven Dake [Wed, 27 Feb 2013 17:26:46 +0000 (10:26 -0700)]
Update infrastructure to more closely match other OpenStack projects
This patch imports nova's HACKING.rst guidelines altered for Heat.
This patch imports nova's run_pep8.sh with some minor alterations.
This patch imports nova's hacking.py extensions to pep8.
This patch places the run_pep8 logic in a separate file rather than
having it spread between tox.ini and run_tests.sh. The HACKING.rst
requirements as well as general pep8 requirements are then enforced
with run_pep8.sh.
Avoid running once the N802 rule until dependency changelogs are
less then 50 characters.
Steven Hardy [Thu, 28 Feb 2013 15:13:48 +0000 (15:13 +0000)]
heat tools : openstack script install mysql via openstack-db
Don't install mysql-server in tools/openstack, instead allow
openstack-db to non-interactively install it for us, which means
the root password is set as per the -r password option when
installing on a fresh system with no mysql
NOTE : if testing this on a system which has had mysql installed,
do yum remove mysql-server && rm -fr /var/lib/mysql or the
reinstalled mysql will use the old credentials
Steven Hardy [Tue, 26 Feb 2013 14:20:00 +0000 (14:20 +0000)]
heat engine : loadbalancer resource template, refer to StackId
Use the new AWS::StackId pseudo parameter to refer to the stack for
cfn-hup etc, otherwise the stack lookup by name will fail - using
the AWS::StackId parameter means we'll refer to the stack via the
full ARN and the CFN API will be able to lookup the nested stack.