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

Feature #2763: Add group/template to onedb import-slave

This commit is contained in:
Carlos Martín 2014-03-04 12:05:41 +01:00
parent cee9188aaa
commit fce451fc72

View File

@ -387,6 +387,20 @@ EOT
end
end
slave_template = slave_doc.root.at_xpath("TEMPLATE")
master_template = master_doc.root.at_xpath("TEMPLATE")
# Avoid duplicated template attributes, removing
# them from the slave template
master_template.children.each do |e|
if slave_template.at_xpath(e.name)
slave_template.at_xpath(e.name).remove
end
end
# Add slave template attributes to master template
master_template << slave_template.children
@db[:group_pool].where(:oid => new_group[:oid]).update(
:body => master_doc.root.to_s)
else