Sha256: 1dee69dc6a115a0620f0e8703b25887b0a4779276378b23771c2d2c69578d1ea

Contents?: true

Size: 1.49 KB

Versions: 3

Compression:

Stored size: 1.49 KB

Contents

#
# Copyright 2010 Red Hat, Inc.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of
# the License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.

require 'rubygems'
require 'boxgrinder-build/helpers/guestfs-helper'
require 'boxgrinder-core/helpers/exec-helper'
require 'logger'

module BoxGrinder
  class ApplianceCustomizeHelper

    def initialize( config, appliance_config, disk, options = {} )
      @config           = config
      @appliance_config = appliance_config
      @disk             = disk

      @log          = options[:log]         || Logger.new(STDOUT)
      @exec_helper  = options[:exec_helper] || ExecHelper.new( { :log => @log } )
    end

    def customize
      @guestfs_helper = GuestFSHelper.new( @disk, :log => @log ).run
      @guestfs = @guestfs_helper.guestfs

      yield @guestfs, @guestfs_helper

      @guestfs_helper.clean_close
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
boxgrinder-build-0.7.1 lib/boxgrinder-build/helpers/appliance-customize-helper.rb
boxgrinder-build-0.7.0 lib/boxgrinder-build/helpers/appliance-customize-helper.rb
boxgrinder-build-0.6.5 lib/boxgrinder-build/helpers/appliance-customize-helper.rb