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

Feature #2694: Code cleanup

This commit is contained in:
Carlos Martín 2014-02-13 17:42:49 +01:00
parent 85efb54fb7
commit 6f829b5db5

View File

@ -747,102 +747,4 @@ EOT
:other_u => row[:other_u])
end
end
################################################################################
################################################################################
################################################################################
=begin
def rename_user_resources(db, oid, name, new_oid, new_name)
db.fetch("SELECT * FROM old_template_pool WHERE uid = #{oid}") do |row|
doc = Nokogiri::XML(row[:body])
doc.root.at_xpath("UID").content = new_oid.to_s
doc.root.at_xpath("UNAME").content = new_name
db[:template_pool].insert(
:oid => row[:oid],
:name => row[:name],
:body => doc.root.to_s,
:uid => new_oid,
:gid => row[:gid],
:owner_u => row[:owner_u],
:group_u => row[:group_u],
:other_u => row[:other_u])
end
db.fetch("SELECT * FROM old_image_pool WHERE uid = #{oid}") do |row|
doc = Nokogiri::XML(row[:body])
doc.root.at_xpath("UID").content = new_oid.to_s
doc.root.at_xpath("UNAME").content = new_name
db[:image_pool].insert(
:oid => row[:oid],
:name => row[:name],
:body => doc.root.to_s,
:uid => new_oid,
:gid => row[:gid],
:owner_u => row[:owner_u],
:group_u => row[:group_u],
:other_u => row[:other_u])
end
db.fetch("SELECT * FROM old_document_pool WHERE uid = #{oid}") do |row|
doc = Nokogiri::XML(row[:body])
doc.root.at_xpath("UID").content = new_oid.to_s
doc.root.at_xpath("UNAME").content = new_name
db[:document_pool].insert(
:oid => row[:oid],
:name => row[:name],
:body => doc.root.to_s,
:type => row[:type],
:uid => new_oid,
:gid => row[:gid],
:owner_u => row[:owner_u],
:group_u => row[:group_u],
:other_u => row[:other_u])
end
db.fetch("SELECT * FROM old_network_pool WHERE uid = #{oid}") do |row|
doc = Nokogiri::XML(row[:body])
doc.root.at_xpath("UID").content = new_oid.to_s
doc.root.at_xpath("UNAME").content = new_name
db[:network_pool].insert(
:oid => row[:oid],
:name => row[:name],
:body => doc.root.to_s,
:uid => new_oid,
:gid => row[:gid],
:owner_u => row[:owner_u],
:group_u => row[:group_u],
:other_u => row[:other_u],
:cid => row[:cid])
end
db.fetch("SELECT * FROM old_vm_pool WHERE uid = #{oid}") do |row|
doc = Nokogiri::XML(row[:body])
doc.root.at_xpath("UID").content = new_oid.to_s
doc.root.at_xpath("UNAME").content = new_name
db[:vm_pool].insert(
:oid => row[:oid],
:name => row[:name],
:body => doc.root.to_s,
:uid => new_oid,
:gid => row[:gid],
:last_poll => row[:last_poll],
:state => row[:state],
:lcm_state => row[:lcm_state],
:owner_u => row[:owner_u],
:group_u => row[:group_u],
:other_u => row[:other_u])
end
# TODO: VMTEMPLATE DISK/IMAGE_UID _UNAME; NIC/NETWORK_UID _UNAME
end
=end
end