Skip to content

Commit

Permalink
Feature #3600: rename the vcenter view to admin_vcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosms committed Feb 24, 2015
1 parent 3b63da4 commit 69e6a5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion install.sh
Expand Up @@ -1532,7 +1532,7 @@ SUNSTONE_ETC_VIEW_FILES="src/sunstone/etc/sunstone-views/admin.yaml \
src/sunstone/etc/sunstone-views/cloud_vcenter.yaml \
src/sunstone/etc/sunstone-views/groupadmin.yaml \
src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml \
src/sunstone/etc/sunstone-views/vcenter.yaml"
src/sunstone/etc/sunstone-views/admin_vcenter.yaml"

SUNSTONE_MODELS_FILES="src/sunstone/models/OpenNebulaJSON.rb \
src/sunstone/models/SunstoneServer.rb \
Expand Down
21 changes: 14 additions & 7 deletions src/onedb/shared/4.6.0_to_4.11.80.rb
Expand Up @@ -75,14 +75,17 @@ def up
if (!elem.nil?)
elem.remove

newtext = (elem.text.split(",").map { |s|
s.strip.
gsub(/^vcenter$/, "admin_vcenter").
gsub(/^vdcadmin$/, "groupadmin")
}).join(",")

# The cleaner doc.create_cdata(txt) is not supported in
# old versions of nokogiri

doc.at_xpath("/GROUP/TEMPLATE").add_child(
doc.create_element(elem_name)).
add_child(Nokogiri::XML::CDATA.new(
doc,
elem.text.gsub("vdcadmin", "groupadmin")))
add_child(Nokogiri::XML::CDATA.new(doc, newtext))
end
end

Expand Down Expand Up @@ -196,11 +199,15 @@ def up
if (!elem.nil?)
elem.remove

newtext = (elem.text.split(",").map { |s|
s.strip.
gsub(/^vcenter$/, "admin_vcenter").
gsub(/^vdcadmin$/, "groupadmin")
}).join(",")

doc.at_xpath("/USER/TEMPLATE").add_child(
doc.create_element("DEFAULT_VIEW")).
add_child(Nokogiri::XML::CDATA.new(
doc,
elem.text.gsub("vdcadmin", "groupadmin")))
add_child(Nokogiri::XML::CDATA.new(doc,newtext))
end

@db[:user_pool].insert(
Expand Down

0 comments on commit 69e6a5b

Please sign in to comment.