- logincluster_arv = Arvados.new({ :api_host => (ENV['LOGINCLUSTER_ARVADOS_API_HOST'] || ENV['ARVADOS_API_HOST']),
- :api_token => (ENV['LOGINCLUSTER_ARVADOS_API_TOKEN'] || ENV['ARVADOS_API_TOKEN']),
- :suppress_ssl_warnings => false })
+ logincluster_host = ENV['ARVADOS_API_HOST']
+ logincluster_name = arv.cluster_config['Login']['LoginCluster'] or ''
+
+ # Requiring the fuse group was previous hardcoded behavior
+ minimum_groups = arv.cluster_config['Users']['SyncRequiredGroups'] || ['fuse']
+ ignored_groups = arv.cluster_config['Users']['SyncIgnoredGroups'] || []
+ (minimum_groups & ignored_groups).each do |group_name|
+ STDERR.puts "WARNING: #{group_name} is listed in both SyncRequiredGroups and SyncIgnoredGroups. It will be ignored."
+ end
+
+ actions.each_pair do |key, default|
+ actions[key] = arv.cluster_config['Users'].fetch(key.to_s, default)
+ end
+
+ if logincluster_name != '' and logincluster_name != arv.cluster_config['ClusterID']
+ logincluster_host = arv.cluster_config['RemoteClusters'][logincluster_name]['Host']
+ end
+ logincluster_arv = Arvados.new({ :api_host => logincluster_host,
+ :suppress_ssl_warnings => false })