lib/abicli/commands/server-settings.rb in abiquo-etk-0.4.33 vs lib/abicli/commands/server-settings.rb in abiquo-etk-0.4.42
- old
+ new
@@ -1,22 +1,16 @@
if ARGV[0] == 'server-settings'
-
ARGV.shift
-
- if not File.directory? ABIQUO_BASE_DIR
- $stderr.puts "\n'abicli set' command is used to configure the Abiquo Platform.\nUnfortunately, I can't find the Abiquo Platform installed in this server.\n\nTry other commands.\n\n"
- help
- exit 1
+ if not File.exist?('/etc/abiquo-release')
+ $stderr.puts "Abiquo release version not found. Unsupported installation."
+ exit
end
-
- def print_server_settings
- f = ABIQUO_BASE_DIR + '/config/server.xml'
- doc = Nokogiri::XML(File.new(f))
- puts
- two_cols("Event Sink URL:".bold, config_get_node(doc, 'eventSinkAddress'))
- two_cols("Session Timeout:".bold, config_get_node(doc, 'sessionTimeout'))
- puts
+ rel_info = File.read('/etc/abiquo-release')
+ if rel_info =~ /Version: 1\.7/
+ load File.dirname(__FILE__) + "/server-settings17.ext"
+ elsif rel_info =~ /Version: 1\.6/
+ load File.dirname(__FILE__) + "/server-settings168.ext"
+ else
+ $stderr.puts "Abiquo release version not found. Unsupported installation."
+ exit
end
-
- print_server_settings
-
end