lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb in boxgrinder-build-0.9.2 vs lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb in boxgrinder-build-0.9.3
- old
+ new
@@ -19,24 +19,26 @@
require 'boxgrinder-build/plugins/base-plugin'
module BoxGrinder
class VMwarePlugin < BasePlugin
def after_init
- set_default_config_value('thin_disk', false)
- validate_plugin_config(['type'], 'http://boxgrinder.org/tutorials/boxgrinder-build-plugins/#VMware_Platform_Plugin')
-
- register_deliverable(:vmx => "#{@appliance_config.name}.vmx",
+ register_deliverable(:vmx => "#{@appliance_config.name}.vmx",
:readme => "README")
if @plugin_config['type'].eql?('personal') and @plugin_config['thin_disk']
register_deliverable(:disk => "#{@appliance_config.name}.vmdk")
else
register_deliverable(:disk => "#{@appliance_config.name}.raw",
:vmdk => "#{@appliance_config.name}.vmdk")
end
end
+ def validate
+ set_default_config_value('thin_disk', false)
+ validate_plugin_config(['type'], 'http://boxgrinder.org/tutorials/boxgrinder-build-plugins/#VMware_Platform_Plugin')
+ end
+
def execute
@log.info "Converting image to VMware #{@plugin_config['type']} format..."
case @plugin_config['type']
when 'personal'
@@ -77,11 +79,11 @@
h = 255
s = 63
end
end
- c = disk_size / (h*s*512)
+ c = disk_size / (h*s*512)
total_sectors = disk_size / 512
[c.to_i, h.to_i, s.to_i, total_sectors.to_i]
end
@@ -186,6 +188,6 @@
@log.debug "VMware enterprise image was built."
end
end
end
-plugin :class => BoxGrinder::VMwarePlugin, :type => :platform, :name => :vmware, :full_name => "VMware"
+plugin :class => BoxGrinder::VMwarePlugin, :type => :platform, :name => :vmware, :full_name => "VMware"