Sha256: 9af54247c8d55d14a634964907578c5587ab44cbf9b9ea81da7173c865512572
Contents?: true
Size: 1.82 KB
Versions: 3
Compression:
Stored size: 1.82 KB
Contents
# Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. module Aeolus module Image module Warehouse class ImageBuild < WarehouseModel @bucket_name = 'builds' def image Image.find(@image) if @image end def target_images TargetImage.where("($build == \"" + @uuid.to_s + "\")") end # Convenience Method to get all provider images for this build def provider_images provider_images = [] target_images.each do |t| provider_images = provider_images + t.provider_images end provider_images end def provider_images_by_provider_and_account(provider, provider_account) provider_images = [] target_images.each do |t| provider_images = provider_images + t.find_provider_image_by_provider_and_account(provider, provider_account) end provider_images end # Deletes this image and all child objects def delete! begin target_images.each do |ti| ti.delete! end rescue NoMethodError end ImageBuild.delete(@uuid) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems