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

Escape strings when inserting vms in onedb

This commit is contained in:
Javi Fontan 2011-06-17 15:26:24 +02:00
parent 43c82e4e7b
commit 6d139a9b75

View File

@ -189,7 +189,15 @@ module Migrator
body = "<VM><ID>#{oid}</ID><UID>#{uid}</UID><GID>#{gid}</GID><NAME>#{name}</NAME><LAST_POLL>#{last_poll}</LAST_POLL><STATE>#{state}</STATE><LCM_STATE>#{lcm_state}</LCM_STATE><STIME>#{row[:stime]}</STIME><ETIME>#{row[:etime]}</ETIME><DEPLOY_ID>#{row[:deploy_id]}</DEPLOY_ID><MEMORY>#{row[:memory]}</MEMORY><CPU>#{row[:cpu]}</CPU><NET_TX>#{row[:net_tx]}</NET_TX><NET_RX>#{row[:net_rx]}</NET_RX>#{row[:template]}#{history}</VM>"
@db.run "INSERT INTO vm_pool VALUES(#{oid},'#{name}','#{body}', #{uid}, #{gid}, #{last_poll}, #{state}, #{lcm_state});"
@db[:vm_pool].insert(
:oid => oid,
:name => name,
:body => body,
:uid => uid,
:gid => gid,
:last_poll => last_poll,
:state => state,
:lcm_state => lcm_state)
end