Merge branch '6859-fix-invalid-manifests' refs #6859
[arvados.git] / services / login-sync / bin / arvados-login-sync
index b9cecb686028fff8caffc9bb79a5e57203c4bb44..fc11e2776b93c62d4a6580e24a5b92e027f963e0 100755 (executable)
@@ -25,11 +25,7 @@ begin
 
   vm_uuid = ENV['ARVADOS_VIRTUAL_MACHINE_UUID']
 
-  begin
-    logins = arv.virtual_machine.get_all_logins(limit: 10000, uuid: vm_uuid)[:items]
-  rescue
-    logins = arv.virtual_machine.logins(:uuid => vm_uuid)[:items]
-  end
+  logins = arv.virtual_machine.logins(:uuid => vm_uuid)[:items]
   logins = [] if logins.nil?
   logins = logins.reject { |l| l[:username].nil? or l[:hostname].nil? or l[:public_key].nil? or l[:virtual_machine_uuid] != vm_uuid }
 
@@ -81,7 +77,7 @@ begin
       groups << "fuse"
       groups.select! { |name| gids[name] }
       # Create new user
-      next unless system("/usr/sbin/useradd", "-m",
+      next unless system("useradd", "-m",
                          "-c", l[:username],
                          "-s", "/bin/bash",
                          "-G", groups.join(","),