Allow compatibility with older AppScale tools which do not pass instance type under roles/nodes.
@@ -755,13 +755,12 @@ class Djinn
raise AppScaleException.new(msg)
end
if !node['public_ip'] || !node['private_ip'] || !node['jobs'] ||
- !node['instance_id'] || !node['instance_type']
+ !node['instance_id']
msg = "Error: node layout is missing information #{node}."
Djinn.log_error(msg)
raise AppScaleException.new(msg)
elsif node['public_ip'].empty? || node['private_ip'].empty? ||
- node['jobs'].empty? || node['instance_id'].empty? ||
- node['instance_type'].empty?
+ node['jobs'].empty? || node['instance_id'].empty?
msg = "Error: node layout is missing information #{node}."
Djinn.log_error(msg)
raise AppScaleException.new(msg)
@@ -1012,11 +1011,16 @@ class Djinn
@options['ec2_url'] = @options['EC2_URL']
end
+ Djinn.log_warn("OPTIONS #{@options}")
@nodes.each { |node|
if node.jobs.include? 'compute'
+ if not node.instance_type.nil?
@options['compute_instance_type'] = node.instance_type
break
end
+ @options['compute_instance_type'] = @options['instance_type']
+ break
+ end
}
'OK'
