Steven Hardy [Thu, 23 May 2013 10:21:16 +0000 (11:21 +0100)]
engine : move update_template_diff functions into Resource
Move the update_template_diff and update_template_diff_properties
functions into resource.Resource - since they now raise
resource.UpdateReplace we can avoid ever calling handle_update if
the resource update will result in replacement
Note a further cleanup will probably be to combine the two diff
functions into one recursive diff, which will further simplify this
update_template_diff already throws resource.UpdateReplace if the
json_snippet contains changes other than to Metadata, so the else
here is unreachable and redundant
Steven Hardy [Thu, 23 May 2013 14:42:01 +0000 (15:42 +0100)]
engine : replace UPDATE_REPLACE with ResourceReplace exception
Replace the handle_update returned value with a new ResourceReplace
exception, which allows the replacement logic in resource.py and
parser.py to be cleaner
Zane Bitter [Wed, 22 May 2013 10:40:33 +0000 (12:40 +0200)]
Stub out sleeps in quantum unit tests
The patch 5d86e2f2ece51a79102aee2af9a3f306c929aaea
added wait states into the unit tests for quantum networks, routers and
ports, but did not stub out the resulting sleep. This caused the tests to
run for over 1s, which indirectly allowed bug #1182285 to become visible.
Thomas Herve [Wed, 22 May 2013 08:23:50 +0000 (10:23 +0200)]
Remove unrelated tracebacks from test output
This mocks some calls the ThreadGroup when testing update and delete of
the stack, resulting in tracebacks when the threads randomly run later
on in the test suite.
Steven Dake [Thu, 16 May 2013 04:48:36 +0000 (21:48 -0700)]
Rename requires files to standard names
From bug report:
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files and tools in the
general world are growing intelligence about them.
Steven Hardy [Tue, 21 May 2013 22:06:11 +0000 (23:06 +0100)]
engine : Fix ResourceFailure exception issues
Fix some issues spotted in https://review.openstack.org/#/c/29543
These errors were spotted after the patch was merged, the
ResourceFailure exception takes an Exception not string argument
Winson Chan [Fri, 17 May 2013 18:30:33 +0000 (11:30 -0700)]
UpdateStack for AWS::AutoScaling::ScalingPolicy
Implemented update support of the ScalingPolicy resource
in an existing stack. ScalingAdjustment, AdjustmentType,
and Cooldown properties are allowed properties for update.
A handle_update method is added to update differences in
the template.
Steven Hardy [Fri, 17 May 2013 13:20:31 +0000 (14:20 +0100)]
engine : remove unused update states/status
We have some aws-isms in the update code related to different
update states, which is not actually used anywhere, so may as
well remove it - it's probably easier at least for now to focus
on the three update states of COMPLETE/FAILED/REPLACEMENT
Steven Hardy [Fri, 17 May 2013 12:17:57 +0000 (13:17 +0100)]
engine : cleanup Resource.update error paths
The current update code uses a nasty pattern where returning an
arbitrary string from Resource.update is interpreted in parser.Stack
as an error. Instead use exceptions which is much nicer :)
Dave Wilde [Sun, 19 May 2013 10:05:39 +0000 (10:05 +0000)]
Adds sudo check for privileged operations.
Adds root user check to determine whether or not sudo is required
for MySQL status and installation. We now run sudo -l to verify
that the user is in the sudoers file, the credentials are then
cached for the rest of the operations.
Michael Still [Sat, 18 May 2013 23:17:47 +0000 (09:17 +1000)]
The utils module in oslo is no more.
The utils module in oslo has been removed (with most of its
functionality moving across to strutils). Luckily it was imported
in heat but never actually used, so removing it is relatively easy.
Monty Taylor [Thu, 16 May 2013 16:24:17 +0000 (09:24 -0700)]
Clean up a pyflakes error in a comment.
This is a little-bit silly, but it's the last thing. pyflakes parses
python lines that are in docstring comments that are prefaced by >>>.
So, without the import, pyflakes complains about undefined import.
Monty Taylor [Thu, 16 May 2013 16:20:51 +0000 (09:20 -0700)]
Align usage of test skipping.
There were three different mechanisms for skipping tests in the suite.
For the most part, skipIf was used, so sync to that. Additionally, it
was being used as a decorater in most places, but as a call in a few,
so make it a decorator everywhere. Finally, if it's on the setUp method,
it's not necessary for it to be on any of the individual tests in the class.
Steve Baker [Fri, 17 May 2013 01:47:28 +0000 (13:47 +1200)]
Initialise resources when service is created.
Without this, calls to validate_template will fail until the first
parser.Stack is created.
resources.initialise() is called in EngineService __init__
to avoid this happening in another service method in the future Fixes: bug #1181045
Change-Id: I68a74ec7993aff4b74d449a3ae33315b93e9cb0d
Zane Bitter [Wed, 15 May 2013 20:26:09 +0000 (22:26 +0200)]
Clean up import of cinderclient exceptions
Don't import a particular version of the cinderclient API - just import the
client module and pass the version we want to the Client() constructor as
is intended. This allows up to access the exceptions directly through
client.exceptions, rather than having to do a separate import.
Zane Bitter [Thu, 16 May 2013 11:18:19 +0000 (13:18 +0200)]
Handle errors in Volume creation
Set the resource_id as soon as it is know, since we need to be able to
delete the volume later, even if it is in an error state. Avoid attempting
to perform a snapshot if the volume was never created successfully.
Zane Bitter [Thu, 16 May 2013 11:18:18 +0000 (13:18 +0200)]
Rename handle_snapshot and pass state
Rename handle_snapshot() to handle_snapshot_delete() to better reflect what
it needs to do (both take a snapshot of the resource and then delete the
resource). Also, pass the state of the resource prior to delete being
invoked, since the resource may want to use different error handling in the
snapshot phase depending on e.g. whether the resource was created
successfully or not.
Zane Bitter [Wed, 15 May 2013 13:59:38 +0000 (15:59 +0200)]
Clean up VPC unit tests
- Ensure that stacks are cleaned up on failure.
- Add a test for the case where an something other than a valid reference
is passed as the GroupSet.
- Add a test for the case where no GroupSet is passed.
Steve Baker [Tue, 14 May 2013 23:43:44 +0000 (11:43 +1200)]
Use python logging for loguserdata.py, log to console
Python logging is configured with a stream handler and should
also replicate the previous logging to 0600 /var/log/heat-provision.log
By logging to a stream handler cloud-init will write to its log,
which will show up in the server console log. This means that heat
provisioning can now be monitored without needing to log in with:
nova console-log <servername>
This change also touches the file /var/lib/heat-cfntools/provision-finished
instead of also writing a datestamp to it, which is redundant.
Mark McLoughlin [Thu, 2 May 2013 09:28:20 +0000 (10:28 +0100)]
Copy the RHEL6 eventlet workaround from Oslo
Tests in oslo-incubator now need the horrendous hack to workaround an
issue with eventlet on RHEL6. We've moved the patch_tox_venv tool
and redhat-eventlet.patch into oslo-incubator, so add them to
openstack-common.conf.
Steven Hardy [Mon, 13 May 2013 13:45:56 +0000 (14:45 +0100)]
engine : rename check_active to make it more generic
Rename check_active to check_create_complete, since "active" is
really a detail of Instance state, and so it seems wrong for other
resources which take a long time to create but are not Instance
based (e.g WaitConditions). This change will also allow us to
align other stack "state check" functions with the state we're
checking for in a consistent way (e.g check_delete_complete etc)
Steven Hardy [Fri, 10 May 2013 16:09:34 +0000 (17:09 +0100)]
api : Fix template-show partial URL redirect
All other API actions will provide a redirect if you only provide the
stack ID or name (rather than both), the template URL currently doesn't
because the template subpath is missing from the mapper lookup
Winson Chan [Wed, 8 May 2013 06:13:49 +0000 (23:13 -0700)]
Implement the SubnetId property in the Instance resource
If the SubnetId parameter is given in the template, the handle_create method
in the Instance resource verifies the subnet in quantum and configures the
NetworkInterfaces for the subnet. If no NetworkInterface is specified, a port
is created for the subnet and the nic is configured to use that port.
Steven Hardy [Wed, 8 May 2013 13:43:12 +0000 (14:43 +0100)]
heat-cfn : Make error with missing auth details more obvious
Exit with an error message describing the missing auth details
instead of failing with cryptic "Name or service not known" error
when credentials etc are missing