diff --git a/install.sh b/install.sh index 02c1626db8..928d31a5c5 100755 --- a/install.sh +++ b/install.sh @@ -353,7 +353,6 @@ INSTALL_FILES=( VMWARE_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/vmware DUMMY_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/dummy LVM_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/lvm - VMWARE_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/vmware IMAGE_DRIVER_FS_SCRIPTS:$VAR_LOCATION/remotes/image/fs NETWORK_HOOK_SCRIPTS:$VAR_LOCATION/remotes/vnm EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples diff --git a/src/cli/onevnet b/src/cli/onevnet index 72ab53716a..b5101c05a6 100755 --- a/src/cli/onevnet +++ b/src/cli/onevnet @@ -136,7 +136,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do Changes the Virtual Network group EOT - command :chgrp, chgrp_desc,[:range, :vnid_list], :groupid do + command :chgrp, chgrp_desc,[:range, :vnetid_list], :groupid do helper.perform_actions(args[0],options,"Group changed") do |vn| vn.chown(-1, args[1].to_i) end @@ -146,7 +146,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do Changes the Virtual Network owner and group EOT - command :chown, chown_desc, [:range, :vnid_list], :userid, + command :chown, chown_desc, [:range, :vnetid_list], :userid, [:groupid,nil] do gid = args[2].nil? ? -1 : args[2].to_i helper.perform_actions(args[0],options,"Owner/Group changed") do |vn| diff --git a/src/cloud/common/CloudAuth.rb b/src/cloud/common/CloudAuth.rb index f3fe29ca15..b69934dd81 100644 --- a/src/cloud/common/CloudAuth.rb +++ b/src/cloud/common/CloudAuth.rb @@ -44,8 +44,11 @@ class CloudAuth def initialize(conf) @conf = conf + # @token_expiration_delta: Number of seconds that will be used + # the same timestamp for the token generation + # @token_expiration_time: Current timestamp to be used in tokens. @token_expiration_delta = @conf[:token_expiration_delta] || EXPIRE_DELTA - @token_expiration_time = Time.now.to_i + @token_expiration_delta + @token_expiration_time = Time.now.to_i + @token_expiration_delta if AUTH_MODULES.include?(@conf[:auth]) require 'CloudAuth/' + AUTH_MODULES[@conf[:auth]] @@ -78,14 +81,23 @@ class CloudAuth Client.new(token,@conf[:one_xmlrpc]) end + def update_userpool_cache + @user_pool = OpenNebula::UserPool.new(client) + + rc = @user_pool.info + if OpenNebula.is_error?(rc) + raise rc.message + end + end + protected def expiration_time time_now = Time.now.to_i if time_now > @token_expiration_time - EXPIRE_MARGIN - update_userpool_cache @token_expiration_time = time_now + @token_expiration_delta + update_userpool_cache end @token_expiration_time @@ -97,15 +109,6 @@ class CloudAuth @user_pool end - def update_userpool_cache - @user_pool = OpenNebula::UserPool.new(client) - - rc = @user_pool.info - if OpenNebula.is_error?(rc) - raise rc.message - end - end - def get_password(username, non_public_user=false) if non_public_user == true xp="USER[NAME=\"#{username}\" and AUTH_DRIVER!=\"public\"]/PASSWORD" diff --git a/src/cloud/occi/lib/ImageOCCI.rb b/src/cloud/occi/lib/ImageOCCI.rb index 11c60ae79a..cd573554c3 100755 --- a/src/cloud/occi/lib/ImageOCCI.rb +++ b/src/cloud/occi/lib/ImageOCCI.rb @@ -23,17 +23,15 @@ class ImageOCCI < Image <%= self.id.to_s %> <%= self.name %> - <% if self['TEMPLATE/TYPE'] != nil %> - <%= self['TEMPLATE/TYPE'] %> + <% if self['TYPE'] != nil %> + <%= self['TYPE'] %> <% end %> <% if self['TEMPLATE/DESCRIPTION'] != nil %> <%= self['TEMPLATE/DESCRIPTION'] %> <% end %> - <% if size != nil %> - <%= size.to_i / 1024 %> - <% end %> - <% if fstype != nil %> - <%= fstype %> + <%= self['SIZE'] %> + <% if self['FSTYPE'] != nil %> + <%= self['FSTYPE'] %> <% end %> <%= self['PUBLIC'] == "0" ? "NO" : "YES"%> <%= self['PERSISTENT'] == "0" ? "NO" : "YES"%> @@ -84,25 +82,18 @@ class ImageOCCI < Image # Creates the OCCI representation of an Image def to_occi(base_url) - size = nil - begin - if self['SOURCE'] != nil and File.exists?(self['SOURCE']) - size = File.stat(self['SOURCE']).size - size = size / 1024 - end - - fstype = self['TEMPLATE/FSTYPE'] if self['TEMPLATE/FSTYPE'] + occi_im = ERB.new(OCCI_IMAGE) + occi_im_text = occi_im.result(binding) rescue Exception => e error = OpenNebula::Error.new(e.message) return error end - occi = ERB.new(OCCI_IMAGE) - return occi.result(binding).gsub(/\n\s*/,'') + return occi_im_text.gsub(/\n\s*/,'') end - def to_one_template() + def to_one_template if @image_info == nil error_msg = "Missing STORAGE section in the XML body" error = OpenNebula::Error.new(error_msg) diff --git a/src/ozones/Server/public/css/application.css b/src/ozones/Server/public/css/application.css index 1ecaeec46d..e8212b067b 100644 --- a/src/ozones/Server/public/css/application.css +++ b/src/ozones/Server/public/css/application.css @@ -471,15 +471,15 @@ tr.even:hover{ font-size: 1.2em; } -.jGrowl-notification, .jGrowl-closer, .jGrowl-notify-submit { +.jGrowl-notification, .jGrowl-notify-submit { border: 2px #444444 solid; - background-color: #F3F3F3; + background-color: #F3F3F3!important; color: #666666; } .jGrowl-notify-error { border: 2px #660000 solid; - background-color: #F39999; + background-color: #F39999!important; color: #660000; } diff --git a/src/sunstone/public/css/application.css b/src/sunstone/public/css/application.css index 03dc2c0a14..612e9fd012 100644 --- a/src/sunstone/public/css/application.css +++ b/src/sunstone/public/css/application.css @@ -478,15 +478,15 @@ tr.even:hover{ font-size: 1.2em; } -.jGrowl-notification, .jGrowl-closer, .jGrowl-notify-submit { +.jGrowl-notification, .jGrowl-notify-submit { border: 2px #444444 solid; - background-color: #F3F3F3; + background-color: #F3F3F3!important; color: #666666; } .jGrowl-notify-error { border: 2px #660000 solid; - background-color: #F39999; + background-color: #F39999!important; color: #660000; } diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index b23bb3f279..95b2bce189 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -686,6 +686,12 @@ function setupConfirmDialogs(){ var value = $(this).val(); var action = SunstoneCfg["actions"][value]; var param = $('select#confirm_select',context).val(); + + if (!param.length){ + notifyError("You must select a value"); + return false; + }; + if (!action) { notifyError("Action "+value+" not defined."); return false;}; switch (action.type){ case "multiple": //find the datatable diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 3be88d9db6..9e01ccb960 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -89,6 +89,7 @@ helpers do def build_session begin + settings.cloud_auth.update_userpool_cache result = settings.cloud_auth.auth(request.env, params) rescue Exception => e error 500, e.message