From 57685e1be83b8efe5cf6ff38322006b6fff5686c Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Tue, 27 Sep 2011 12:31:35 +0200 Subject: [PATCH 01/12] Remove debug data --- src/ozones/Server/models/OzonesServer.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ozones/Server/models/OzonesServer.rb b/src/ozones/Server/models/OzonesServer.rb index a11e8cc132..0c38ff1a5a 100644 --- a/src/ozones/Server/models/OzonesServer.rb +++ b/src/ozones/Server/models/OzonesServer.rb @@ -278,8 +278,6 @@ class OzonesServer data = result if !OpenNebula.is_error?(result) end - puts data - resource = case kind when "vdc" then vdc_data=Hash.new From 5c788e6d467ab3943663b509c2039fdf147f4d09 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 20 Sep 2011 22:58:28 +0200 Subject: [PATCH 02/12] Change "ONE Auth" into "Oneadmin user" when creating zone (cherry picked from commit 4bf0da787fe0dcbca32c9a69a6c2ba401d9c1a48) --- src/ozones/Server/public/js/plugins/zones-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ozones/Server/public/js/plugins/zones-tab.js b/src/ozones/Server/public/js/plugins/zones-tab.js index ffdd2d0069..eb090916d3 100644 --- a/src/ozones/Server/public/js/plugins/zones-tab.js +++ b/src/ozones/Server/public/js/plugins/zones-tab.js @@ -41,7 +41,7 @@ var create_zone_tmpl =
\ \
\ - \ + \
\ \ \ From 92443f762721194fafc5530bcd637a951ac0d8b4 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 20 Sep 2011 22:59:21 +0200 Subject: [PATCH 03/12] Log to stderr VNC proxy command when starting it (cherry picked from commit 8ff6baf1090c6a3696cf6d0cd2277e9e8538a15d) --- src/sunstone/models/SunstoneServer.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index 02283816a4..03c73d4576 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -229,6 +229,8 @@ class SunstoneServer begin novnc_cmd = "#{config[:novnc_path]}/utils/wsproxy.py" + novnc_exec = "#{novnc_cmd} #{proxy_port} #{host}:#{vnc_port}" + $stderr.puts("Starting vnc proxy: #{novnc_exec}") pipe = IO.popen("#{novnc_cmd} #{proxy_port} #{host}:#{vnc_port}") rescue Exception => e error = Error.new(e.message) From 71160ee51c314717f150f6bcd47921ccd4efdc60 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 23 Sep 2011 20:21:24 +0200 Subject: [PATCH 04/12] Fix typo in oZones dashboard (cherry picked from commit a9535fa0f75da1c6d8b4d49abf6c02c662eb1b26) --- src/ozones/Server/public/js/plugins/dashboard-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ozones/Server/public/js/plugins/dashboard-tab.js b/src/ozones/Server/public/js/plugins/dashboard-tab.js index a0b43908e1..1d9a663522 100644 --- a/src/ozones/Server/public/js/plugins/dashboard-tab.js +++ b/src/ozones/Server/public/js/plugins/dashboard-tab.js @@ -36,7 +36,7 @@ var dashboard_tab_content = \ \
\ -

Virtual Data Center\ +

Virtual Data Centers\
\ +\
\ From 5b3350bfd6acb119ace3d27b4fbb17c5e43cfafb Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 23 Sep 2011 20:44:14 +0200 Subject: [PATCH 05/12] Ozones: Add Sunstone endpoint to zone creation dialog and info panel (cherry picked from commit a4154ebdff8c3c8f44c14b398355e6a952498899) --- src/ozones/Server/public/js/plugins/zones-tab.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ozones/Server/public/js/plugins/zones-tab.js b/src/ozones/Server/public/js/plugins/zones-tab.js index eb090916d3..80980d2945 100644 --- a/src/ozones/Server/public/js/plugins/zones-tab.js +++ b/src/ozones/Server/public/js/plugins/zones-tab.js @@ -45,6 +45,8 @@ var create_zone_tmpl =
\ \ \ + \ +
\

\ \
\ @@ -298,6 +300,10 @@ function updateZoneInfo(req,zone_json){ Endpoint\ '+zone.endpoint+'\ \ + \ + Sunstone endpoint\ + '+zone.sunsendpoint+'\ + \ \ #VDCs\ '+zone.vdcs.length+'\ @@ -544,6 +550,7 @@ function setupCreateZoneDialog(){ var endpoint = $('#endpoint',this).val(); var onename = $('#onename',this).val(); var onepass = $('#onepass',this).val(); + var sunsendpoint = $('#sunsendpoint',this).val(); if (!name.length || !endpoint.length || !onename.length || !onepass.length){ @@ -556,7 +563,8 @@ function setupCreateZoneDialog(){ "name": name, "endpoint": endpoint, "onename": onename, - "onepass": onepass + "onepass": onepass, + "sunsendpoint" : sunsendpoint } }; From 4a475ae7e534316213a02cbd2650a5b11340f392 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 26 Sep 2011 20:01:27 +0200 Subject: [PATCH 06/12] Small oZones fixes: Adjust zone name column with and hyperlink sunstone endpoint text. (cherry picked from commit 92fc3f539a55f927c369df2eb90777fc7b77b027) --- src/ozones/Server/public/js/plugins/zones-tab.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ozones/Server/public/js/plugins/zones-tab.js b/src/ozones/Server/public/js/plugins/zones-tab.js index 80980d2945..8f792209cd 100644 --- a/src/ozones/Server/public/js/plugins/zones-tab.js +++ b/src/ozones/Server/public/js/plugins/zones-tab.js @@ -302,7 +302,7 @@ function updateZoneInfo(req,zone_json){ \ \ Sunstone endpoint\ - '+zone.sunsendpoint+'\ + '+zone.sunsendpoint+'\ \ \ #VDCs\ @@ -597,7 +597,8 @@ $(document).ready(function(){ "sPaginationType": "full_numbers", "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "60px", "aTargets": [0,2] }, + { "sWidth": "60px", "aTargets": [0] }, + { "sWidth": "300px", "aTargets": [3] }, { "sWidth": "35px", "aTargets": [1] } ] }); From 5b3a0a6662bc888af6bfd71e1315ec7b2a8ef365 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 26 Sep 2011 20:05:32 +0200 Subject: [PATCH 07/12] Use the same string that was logged to launch the proxy (cherry picked from commit ab3da924718161be7b65007aeee32feadd8ecfec) --- src/sunstone/models/SunstoneServer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index 03c73d4576..297bd58425 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -231,7 +231,7 @@ class SunstoneServer novnc_cmd = "#{config[:novnc_path]}/utils/wsproxy.py" novnc_exec = "#{novnc_cmd} #{proxy_port} #{host}:#{vnc_port}" $stderr.puts("Starting vnc proxy: #{novnc_exec}") - pipe = IO.popen("#{novnc_cmd} #{proxy_port} #{host}:#{vnc_port}") + pipe = IO.popen(novnc_exec) rescue Exception => e error = Error.new(e.message) return [500, error.to_json] From 51fce30e2f819dfe251e215818ffe4c6a21eb608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 23 Sep 2011 16:56:55 +0200 Subject: [PATCH 08/12] onedb: add migrator from 2.9.85 to 2.9.90(cherry picked from commit d6621dc598585eeef67db167b3a0a52f5e5d1b9a) --- install.sh | 1 + src/onedb/2.9.85_to_2.9.90.rb | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/onedb/2.9.85_to_2.9.90.rb diff --git a/install.sh b/install.sh index 72fb72b1d7..ef9069846a 100755 --- a/install.sh +++ b/install.sh @@ -652,6 +652,7 @@ IMAGE_DRIVER_FS_SCRIPTS="src/image_mad/remotes/fs/cp \ #------------------------------------------------------------------------------- ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \ src/onedb/2.9.80_to_2.9.85.rb \ + src/onedb/2.9.85_to_2.9.90.rb \ src/onedb/onedb.rb \ src/onedb/onedb_backend.rb" diff --git a/src/onedb/2.9.85_to_2.9.90.rb b/src/onedb/2.9.85_to_2.9.90.rb new file mode 100644 index 0000000000..53a7d084ae --- /dev/null +++ b/src/onedb/2.9.85_to_2.9.90.rb @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------- * +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# Licensed under the Apache License, Version 2.0 (the "License"); you may * +# not use this file except in compliance with the License. You may obtain * +# a copy of the License at * +# * +# http://www.apache.org/licenses/LICENSE-2.0 * +# * +# Unless required by applicable law or agreed to in writing, software * +# distributed under the License is distributed on an "AS IS" BASIS, * +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +# See the License for the specific language governing permissions and * +# limitations under the License. * +# -------------------------------------------------------------------------- * + +require "rexml/document" +include REXML + +module Migrator + def db_version + "2.9.90" + end + + def one_version + "OpenNebula 2.9.90" + end + + def up + return true + end +end From a2ad103ad9375ac364b950fa13321952d5d78179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 26 Sep 2011 16:31:54 +0200 Subject: [PATCH 09/12] Bug #832: Restore src/cloud/common/Configuration.rb This reverts 7a530fb77c0334d36b4b2404fc09792e1444197b (cherry picked from commit 9fc7f582e238110e2153bc9083c4345e0cb0417b) --- install.sh | 3 +- src/cloud/common/Configuration.rb | 115 ++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 src/cloud/common/Configuration.rb diff --git a/install.sh b/install.sh index ef9069846a..d187f9b443 100755 --- a/install.sh +++ b/install.sh @@ -792,7 +792,8 @@ RUBY_OPENNEBULA_LIB_FILES="src/oca/ruby/OpenNebula/Host.rb \ COMMON_CLOUD_LIB_FILES="src/cloud/common/CloudServer.rb \ src/cloud/common/CloudClient.rb \ - src/cloud/common/CloudAuth.rb" + src/cloud/common/CloudAuth.rb \ + src/cloud/common/Configuration.rb" COMMON_CLOUD_CLIENT_LIB_FILES="src/cloud/common/CloudClient.rb" diff --git a/src/cloud/common/Configuration.rb b/src/cloud/common/Configuration.rb new file mode 100644 index 0000000000..2189e4ad1a --- /dev/null +++ b/src/cloud/common/Configuration.rb @@ -0,0 +1,115 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +#--------------------------------------------------------------------------- # + +############################################################################### +# The Configuration Class represents a simple configuration file for the +# Cloud servers. It does not check syntax. +############################################################################### +class Configuration + + ########################################################################### + # Patterns to parse the Configuration File + ########################################################################### + + NAME_REG =/[\w\d_-]+/ + VARIABLE_REG =/\s*(#{NAME_REG})\s*=\s*/ + + SIMPLE_VARIABLE_REG =/#{VARIABLE_REG}([^\[]+?)(#.*)?/ + SINGLE_VARIABLE_REG =/^#{SIMPLE_VARIABLE_REG}$/ + ARRAY_VARIABLE_REG =/^#{VARIABLE_REG}\[(.*?)\]/m + + ########################################################################### + ########################################################################### + + def initialize(file) + @conf=parse_conf(file) + end + + def add_configuration_value(key,value) + add_value(@conf,key,value) + end + + def [](key) + @conf[key.to_s.upcase] + end + + ########################################################################### + ########################################################################### + +private + + # + # + # + def add_value(conf, key, value) + if conf[key] + if !conf[key].kind_of?(Array) + conf[key]=[conf[key]] + end + conf[key]< Date: Mon, 26 Sep 2011 17:00:08 +0200 Subject: [PATCH 10/12] onedb: Add 3.0 migrator. It changes the tm_nfs drivers to tm_shared(cherry picked from commit 980222f28eb335ef0c4d66613664f4a99d9148dc) --- install.sh | 1 + src/onedb/2.9.90_to_3.0.rb | 48 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/onedb/2.9.90_to_3.0.rb diff --git a/install.sh b/install.sh index d187f9b443..e6cdb3ea0a 100755 --- a/install.sh +++ b/install.sh @@ -653,6 +653,7 @@ IMAGE_DRIVER_FS_SCRIPTS="src/image_mad/remotes/fs/cp \ ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \ src/onedb/2.9.80_to_2.9.85.rb \ src/onedb/2.9.85_to_2.9.90.rb \ + src/onedb/2.9.90_to_3.0.rb \ src/onedb/onedb.rb \ src/onedb/onedb_backend.rb" diff --git a/src/onedb/2.9.90_to_3.0.rb b/src/onedb/2.9.90_to_3.0.rb new file mode 100644 index 0000000000..8692af3bfe --- /dev/null +++ b/src/onedb/2.9.90_to_3.0.rb @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------- * +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# Licensed under the Apache License, Version 2.0 (the "License"); you may * +# not use this file except in compliance with the License. You may obtain * +# a copy of the License at * +# * +# http://www.apache.org/licenses/LICENSE-2.0 * +# * +# Unless required by applicable law or agreed to in writing, software * +# distributed under the License is distributed on an "AS IS" BASIS, * +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +# See the License for the specific language governing permissions and * +# limitations under the License. * +# -------------------------------------------------------------------------- * + +require "rexml/document" +include REXML + +module Migrator + def db_version + "3.0" + end + + def one_version + "OpenNebula 3.0" + end + + def up + # The tm_nfs driver has been renamed to tm_shared + # CREATE TABLE host_pool (oid INTEGER PRIMARY KEY, name VARCHAR(256), body TEXT, state INTEGER, last_mon_time INTEGER, UNIQUE(name)); + + @db.fetch("SELECT * FROM host_pool") do |row| + doc = Document.new(row[:body]) + + source = nil + doc.root.each_element("TM_MAD") { |e| + if e.text.downcase == "tm_nfs" + e.text = "tm_shared" + + @db[:host_pool].filter(:oid => row[:oid]).update( + :body => doc.root.to_s) + end + } + end + + return true + end +end From 3a36b22644e4629ba617d19586abbacb123413e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 27 Sep 2011 11:41:55 +0200 Subject: [PATCH 11/12] Bug #832: Move Configuration.rb to onedb's lib location (cherry picked from commit fc6de1c4a02a3cf3dd7a1dbdbb1707dbbc141e73) --- install.sh | 6 +++--- src/{cloud/common => onedb}/Configuration.rb | 0 src/onedb/onedb.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/{cloud/common => onedb}/Configuration.rb (100%) diff --git a/install.sh b/install.sh index e6cdb3ea0a..23dc500a82 100755 --- a/install.sh +++ b/install.sh @@ -655,7 +655,8 @@ ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \ src/onedb/2.9.85_to_2.9.90.rb \ src/onedb/2.9.90_to_3.0.rb \ src/onedb/onedb.rb \ - src/onedb/onedb_backend.rb" + src/onedb/onedb_backend.rb \ + src/onedb/Configuration.rb" #------------------------------------------------------------------------------- # Configuration files for OpenNebula, to be installed under $ETC_LOCATION @@ -793,8 +794,7 @@ RUBY_OPENNEBULA_LIB_FILES="src/oca/ruby/OpenNebula/Host.rb \ COMMON_CLOUD_LIB_FILES="src/cloud/common/CloudServer.rb \ src/cloud/common/CloudClient.rb \ - src/cloud/common/CloudAuth.rb \ - src/cloud/common/Configuration.rb" + src/cloud/common/CloudAuth.rb" COMMON_CLOUD_CLIENT_LIB_FILES="src/cloud/common/CloudClient.rb" diff --git a/src/cloud/common/Configuration.rb b/src/onedb/Configuration.rb similarity index 100% rename from src/cloud/common/Configuration.rb rename to src/onedb/Configuration.rb diff --git a/src/onedb/onedb.rb b/src/onedb/onedb.rb index 2d1210a55f..d528310b3b 100644 --- a/src/onedb/onedb.rb +++ b/src/onedb/onedb.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'cloud/Configuration' +require 'Configuration' require 'onedb_backend' class OneDB From fcb98539ce99109c4af3527415abb680cdb3556b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 27 Sep 2011 12:32:08 +0200 Subject: [PATCH 12/12] Allow user passwords with ':' characters (cherry picked from commit 6c5e90eb844e70df23e5cb0f37782e8f4b272299) --- src/authm_mad/one_auth_mad.rb | 2 +- src/um/User.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/authm_mad/one_auth_mad.rb b/src/authm_mad/one_auth_mad.rb index b1d40bcaf9..7f6a0b9f82 100755 --- a/src/authm_mad/one_auth_mad.rb +++ b/src/authm_mad/one_auth_mad.rb @@ -117,7 +117,7 @@ class AuthDriver < OpenNebulaDriver authN_path = File.join(@local_scripts_path, protocol) command = File.join(authN_path,ACTION[:authN].downcase) - command << ' ' << user << ' ' << password << ' ' << secret_attr.join(' ') + command << ' ' << user << ' ' << password << ' ' << secret_attr.join(':') local_action(command, request_id, ACTION[:authN]) end diff --git a/src/um/User.cc b/src/um/User.cc index 71b2d4cd28..c649eace68 100644 --- a/src/um/User.cc +++ b/src/um/User.cc @@ -27,7 +27,7 @@ #include "Group.h" -const string User::INVALID_CHARS = " :\t\n\v\f\r"; +const string User::INVALID_CHARS = " \t\n\v\f\r"; /* ************************************************************************** */ /* User :: Database Access Functions */