25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'app/controllers/staypuft/steps_controller.rb', line 25
def update
case step
when :deployment_settings
@layouts = ordered_layouts
@deployment.form_step = Deployment::STEP_SETTINGS
@deployment.passwords.attributes = params[:staypuft_deployment].delete(:passwords)
@deployment.attributes = params[:staypuft_deployment]
pxe_network = Subnet.where('dhcp_id IS NOT NULL').first
if pxe_network
@deployment.unassigned_pxe_default_subnet_types.each do |type|
@deployment.subnet_typings.new(:subnet_id => pxe_network.id, :subnet_type_id => type.id).save
end
end
when :services_overview
@deployment.form_step = Deployment::STEP_OVERVIEW
when :services_configuration
@services_map = [:nova, :neutron, :glance, :cinder]
if params[:staypuft_deployment]
@deployment.form_step = Deployment::STEP_CONFIGURATION
@services_map.each do |service|
@deployment.send(service).attributes = params[:staypuft_deployment].delete(service)
end
end
when :network_configuration
@deployment.form_step = Deployment::STEP_NETWORKING
@subnets = Subnet.search_for(params[:search], :order => params[:order]).includes(:domains, :dhcp).paginate :page => params[:page]
else
raise 'unknown step'
end
render_wizard @deployment
end
|