1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

bug #1495: Do not update sunstone-plugins.yaml after detecting new plugins.

* Sunstone plugins must be included manually to sunstone-plugins.yaml
This commit is contained in:
Daniel Molina 2012-10-01 16:31:53 +02:00
parent 9963fcb606
commit c8738d410c

View File

@ -18,8 +18,6 @@ require 'yaml'
require 'json'
class SunstonePlugins
USER_PLUGIN_POLICY = false # or true to enable them by default
attr_reader :plugins_conf
def initialize
@ -37,26 +35,18 @@ class SunstonePlugins
@installed_plugins = Array.new
# read user plugins
modified = false
Dir[base_path+'user-plugins/*.js'].each do |p_path|
m = p_path.match(/^#{base_path}(.*)$/)
if m and plugin = m[1]
@installed_plugins << plugin
if !plugins.include? plugin
@plugins_conf << {plugin=>{:ALL => USER_PLUGIN_POLICY,
:user => nil,
:group => nil}}
modified = true
end
if m && m[1]
@installed_plugins << m[1]
end
end
write_conf if modified
# read base plugins
Dir[base_path+'plugins/*.js'].each do |p_path|
m = p_path.match(/^#{base_path}(.*)$/)
if m and plugin = m[1]
@installed_plugins << plugin
if m && m[1]
@installed_plugins << m[1]
end
end
end
@ -99,12 +89,6 @@ class SunstonePlugins
auth_plugins
end
def write_conf
File.open(PLUGIN_CONFIGURATION_FILE,'w') do |f|
f.write(@plugins_conf.to_yaml)
end
end
def to_json
@plugins_conf.to_json
end