Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not send os element when template is not present
  • Loading branch information
lzap committed Jul 31, 2014
1 parent 8b06178 commit 455c657
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions lib/ovirt/vm.rb
Expand Up @@ -74,18 +74,21 @@ def self.to_xml(opts={})
topology( :cores => (opts[:cores] || '1'), :sockets => '1' )
}
end
os({:type => opts[:os_type] || 'unassigned' }){
if(opts[:first_boot_dev] && opts[:first_boot_dev] == 'network')
boot(:dev=> opts[:boot_dev1] || 'network')
boot(:dev=> opts[:boot_dev2] || 'hd')
else
boot(:dev=> opts[:boot_dev2] || 'hd')
boot(:dev=> opts[:boot_dev1] || 'network')
end
kernel (opts[:os_kernel])
initrd (opts[:os_initrd])
cmdline (opts[:os_cmdline])
}
# os element must not be sent when template is present (RHBZ 1104235)
if opts[:template].nil? || opts[:template].empty?
os({:type => opts[:os_type] || 'unassigned' }){
if(opts[:first_boot_dev] && opts[:first_boot_dev] == 'network')
boot(:dev=> opts[:boot_dev1] || 'network')
boot(:dev=> opts[:boot_dev2] || 'hd')
else
boot(:dev=> opts[:boot_dev2] || 'hd')
boot(:dev=> opts[:boot_dev1] || 'network')
end
kernel (opts[:os_kernel])
initrd (opts[:os_initrd])
cmdline (opts[:os_cmdline])
}
end
display_{
type_(opts[:display][:type])
} if opts[:display]
Expand Down

0 comments on commit 455c657

Please sign in to comment.