aeolus-incubator/tim — pull request #117 by mtaylor (2013-03-20 16:34:50+00:00)
Title: Fsm target image

This sits on top of the fsm_delete pull req.

Adds in the ability to delete target images. Deleting a target image will result in deleting all its children. i.e. provider_images. To test this manually you need the branch from sloranz latest pullreq:

https://github.com/aeolusproject/imagefactory/pull/276

The following code will run this manually against factory:

```
template_xml = ""

template = Tim::Template.create(:xml => template_xml)

base_image = Tim::BaseImage.new(:name => "BaseImage")
base_image.template = template
base_image.save

image_version = Tim::ImageVersion.new
image_version.base_image = base_image
image_version.save

target_image = Tim::TargetImage.new(:target => "MockSphere")
target_image.image_version = image_version
target_image.save

provider_account = Tim::ProviderAccount.new

provider_image1 = Tim::ProviderImage.new(:provider => "MockSphere")
provider_image1.provider_account = provider_account
provider_image1.target_image = target_image
provider_image1.save

provider_image2 = Tim::ProviderImage.new(:provider => "MockSphere")
provider_image2.provider_account = provider_account
provider_image2.target_image = target_image
provider_image2.save

target_image.destroy
```