From fac0852c129c92e697395a450645af131a51115c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 24 Apr 2014 15:05:02 +0200 Subject: [PATCH] Fix incompatibility with old nokogiri versions in onedb migrator --- src/onedb/shared/4.4.1_to_4.5.80.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/onedb/shared/4.4.1_to_4.5.80.rb b/src/onedb/shared/4.4.1_to_4.5.80.rb index 3ff6d5f7c5..bb392e741a 100644 --- a/src/onedb/shared/4.4.1_to_4.5.80.rb +++ b/src/onedb/shared/4.4.1_to_4.5.80.rb @@ -133,14 +133,17 @@ module Migrator elem = doc.root.at_xpath(elem_name) txt = elem.nil? ? "" : elem.text + # The cleaner doc.create_cdata(txt) is not supported in + # old versions of nokogiri + template.add_child(doc.create_element(elem_name)). - add_child(doc.create_cdata(txt)) + add_child(Nokogiri::XML::CDATA.new(doc,txt)) end vlan_text = doc.root.at_xpath("VLAN").text == "0" ? "NO" : "YES" template.add_child(doc.create_element("VLAN")). - add_child(doc.create_cdata(vlan_text)) + add_child(Nokogiri::XML::CDATA.new(doc,vlan_text)) @db[:network_pool].insert( :oid => row[:oid],