diff --git a/lib/server_sync.rb b/lib/server_sync.rb index 39367b00..1b644fc6 100644 --- a/lib/server_sync.rb +++ b/lib/server_sync.rb @@ -171,15 +171,15 @@ def self.sync(servers, mode = 'cordon', dryrun = false) def self.dump(verbose) Server.all.to_h do |server| info = { - url: server.url, - secret: server.secret, - load_multiplier: server.load_multiplier.to_f || 1.0, - enabled: server.enabled, + "url" => server.url, + "secret" => server.secret, + "load_multiplier" => server.load_multiplier.to_f || 1.0, + "enabled" => server.enabled?, } if verbose - info[:state] = server.state.presence || server.enabled ? 'enabled' : 'disabled' - info[:load] = server.load.presence || -1.0 - info[:online] = server.online + info["state"] = server.state.presence || (server.enabled? ? 'enabled' : 'disabled') + info["load"] = server.load.presence || -1.0 + info["online"] = server.online end [server.id, info] end diff --git a/lib/tasks/servers.rake b/lib/tasks/servers.rake index 1e396dc4..e0c0108b 100644 --- a/lib/tasks/servers.rake +++ b/lib/tasks/servers.rake @@ -200,7 +200,7 @@ namespace :servers do desc 'Return a yaml compatible with servers:sync' task :yaml, [:verbose] => :environment do |_t, args| - puts({ servers: ServerSync.dump(!!args.verbose) }.to_yaml) + puts({ "servers" => ServerSync.dump(!!args.verbose) }.to_yaml) end desc('List all meetings running in specific BigBlueButton servers')