Skip to content

Commit

Permalink
Fix incompatibility with old nokogiri versions in onedb migrator
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosms committed Apr 24, 2014
1 parent fd4d7f0 commit fac0852
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/onedb/shared/4.4.1_to_4.5.80.rb
Expand Up @@ -133,14 +133,17 @@ def up
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],
Expand Down

0 comments on commit fac0852

Please sign in to comment.