lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb in boxgrinder-build-0.9.4 vs lib/boxgrinder-build/plugins/delivery/ebs/ebs-plugin.rb in boxgrinder-build-0.9.5

- old
+ new

@@ -72,11 +72,11 @@ def execute ebs_appliance_description = "#{@appliance_config.summary} | Appliance version #{@appliance_config.version}.#{@appliance_config.release} | #{@appliance_config.hardware.arch} architecture" @log.debug "Checking if appliance is already registered..." - ami = @ec2helper.ami_by_name(ebs_appliance_name) + ami = ami_by_name(ebs_appliance_name) if ami and @plugin_config['overwrite'] @log.info "Overwrite is enabled. Stomping existing assets." stomp_ebs(ami) elsif ami @@ -170,12 +170,10 @@ def ami_by_name(name) @ec2helper.ami_by_name(name, @plugin_config['account_number']) end - alias :already_registered? :ami_by_name - def terminate_instances(instances) instances.map(&:terminate) instances.each do |i| @ec2helper.wait_for_instance_death(i) end @@ -211,11 +209,11 @@ return "#{base_path}/#{@appliance_config.hardware.arch}" unless @plugin_config['snapshot'] snapshot = 1 - while @ec2helper.already_registered?("#{base_path}-SNAPSHOT-#{snapshot}/#{@appliance_config.hardware.arch}") + while ami_by_name("#{base_path}-SNAPSHOT-#{snapshot}/#{@appliance_config.hardware.arch}") snapshot += 1 end # Reuse the last key (if there was one) snapshot -=1 if snapshot > 1 and @plugin_config['overwrite'] @@ -258,6 +256,6 @@ end end end -plugin :class => BoxGrinder::EBSPlugin, :type => :delivery, :name => :ebs, :full_name => "Elastic Block Storage" \ No newline at end of file +plugin :class => BoxGrinder::EBSPlugin, :type => :delivery, :name => :ebs, :full_name => "Elastic Block Storage"