Skip to content
Snippets Groups Projects
Commit 0814d84a authored by root's avatar root
Browse files

add better logging, and fix issue when course (00000) unknown

parent 8084e03a
Branches 2017
No related tags found
No related merge requests found
......@@ -54,11 +54,15 @@ end
$config.each_key do |course|
puts "Course #{course}"
next if $config[course]
next unless $config[course]
$users = Hash.new {|h,k| h[k] = Hash.new &h.default_proc }
$groups = Hash.new {|h,k| h[k] = Hash.new &h.default_proc }
r = get_group_members($config[course]["element"], course)
unless r and r["UserElementRelation"]
puts "No groups!"
next
end
add_users_and_groups(r, "Main")
all_groups = get_groups($config[course]["element"], course)
......@@ -109,6 +113,8 @@ $config.each_key do |course|
end
end
puts " got #{$users.keys.count} users and #{$groups.keys.count} groups"
File.open("/dumps/" + course + "-users.yaml",'w') do |h|
h.write $users.to_yaml
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment