1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Bug #4467: Rename TEMPLATE/EC2 in onedb migrator

This commit is contained in:
Carlos Martín 2016-05-17 18:52:29 +02:00
parent 9e15666712
commit 6f56934950

View File

@ -193,6 +193,18 @@ module Migrator
doc.root.at_xpath("HISTORY_RECORDS/HISTORY[last()]/CID").content = 0
end
# Bug #4467
elem = doc.at_xpath("/VM/USER_TEMPLATE/EC2")
if (!elem.nil?)
elem.name = "PUBLIC_CLOUD"
if elem.at_xpath("TYPE").nil?
elem.add_child(doc.create_element("TYPE")).content = "ec2"
end
end
row[:body] = doc.root.to_s
end
@ -324,6 +336,18 @@ module Migrator
user_inputs.add_child(doc.create_element("VCPU")).content = "O|fixed|||#{vcpu}"
end
# Bug #4467
elem = doc.at_xpath("/VMTEMPLATE/TEMPLATE/EC2")
if (!elem.nil?)
elem.name = "PUBLIC_CLOUD"
if elem.at_xpath("TYPE").nil?
elem.add_child(doc.create_element("TYPE")).content = "ec2"
end
end
@db[:template_pool].insert(
:oid => row[:oid],
:name => row[:name],