arvados-login-sync 2.3.3 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/arvados-login-sync +12 -4
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebbd1632924ac9c57a7c27c1add22dea0c0b1238b897ba95eec585ebe5f07572
4
- data.tar.gz: d833cf1bb9cd391171af4fb6d03de128f50382f85133ee94687d8be33dbe961e
3
+ metadata.gz: 187519e067d9a0a5019d04997010cbeb0b542f736c5c2585fbc0cd8d0d141cc1
4
+ data.tar.gz: 18e7c489bb7b394529211f395cd7c52706fccc104f9bbad9a4fe30c31923a0ab
5
5
  SHA512:
6
- metadata.gz: 9e05c28aa92f5eb6a3de3f4ae4234c20d98bf0ae77bd6ee977b8207c20d7d7303705e30220e9cc8de22e1cf3d34b63d42226629cbd7ecbef928759b105a0f7fe
7
- data.tar.gz: 03a8045c5754ccf41cae31daf89aa1c0da3f8d74079cb46a759ee035d6fda608a7b2d230c4064384e0339b4d0bdfdcacd7b61e08ff21d457fdc4dbf26c9dfa09
6
+ metadata.gz: fa346fc2bc893d8ee22f52a1eb9a505ac99523e4de947d5cfbf69554812b22e40fcbcb2c2175912365428b3574a0fdba6220b23bf51b5023e5990a3fb71aa376
7
+ data.tar.gz: 637a95b6b14c4480e830bf160c66adf076cd0afa7363b3704aca33496c1a7696956ed517a4a0b2b284ae239aa1745fe2489a382fc0af914b61570fe399073f5e
@@ -10,6 +10,7 @@ require 'etc'
10
10
  require 'fileutils'
11
11
  require 'yaml'
12
12
  require 'optparse'
13
+ require 'open3'
13
14
 
14
15
  req_envs = %w(ARVADOS_API_HOST ARVADOS_API_TOKEN ARVADOS_VIRTUAL_MACHINE_UUID)
15
16
  req_envs.each do |k|
@@ -124,11 +125,12 @@ begin
124
125
  unless pwnam[l[:username]]
125
126
  STDERR.puts "Creating account #{l[:username]}"
126
127
  # Create new user
127
- unless system("useradd", "-m",
128
+ out, st = Open3.capture2e("useradd", "-m",
128
129
  "-c", username,
129
130
  "-s", "/bin/bash",
130
131
  username)
131
- STDERR.puts "Account creation failed for #{l[:username]}: #{$?}"
132
+ if st.exitstatus != 0
133
+ STDERR.puts "Account creation failed for #{l[:username]}:\n#{out}"
132
134
  next
133
135
  end
134
136
  begin
@@ -150,7 +152,10 @@ begin
150
152
  if existing_groups.index(addgroup).nil?
151
153
  # User should be in group, but isn't, so add them.
152
154
  STDERR.puts "Add user #{username} to #{addgroup} group"
153
- system("usermod", "-aG", addgroup, username)
155
+ out, st = Open3.capture2e("usermod", "-aG", addgroup, username)
156
+ if st.exitstatus != 0
157
+ STDERR.puts "Failed to add #{username} to #{addgroup} group:\n#{out}"
158
+ end
154
159
  end
155
160
  end
156
161
 
@@ -158,7 +163,10 @@ begin
158
163
  if groups.index(removegroup).nil?
159
164
  # User is in a group, but shouldn't be, so remove them.
160
165
  STDERR.puts "Remove user #{username} from #{removegroup} group"
161
- system("gpasswd", "-d", username, removegroup)
166
+ out, st = Open3.capture2e("gpasswd", "-d", username, removegroup)
167
+ if st.exitstatus != 0
168
+ STDERR.puts "Failed to remove user #{username} from #{removegroup} group:\n#{out}"
169
+ end
162
170
  end
163
171
  end
164
172
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arvados-login-sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.3
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvados Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-17 00:00:00.000000000 Z
11
+ date: 2022-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: arvados
@@ -73,7 +73,7 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0.12'
75
75
  description: Creates and updates local login accounts for Arvados users. Built from
76
- git commit bc9d8d1e4caeef8c4b2da02f9a134fc7b57148d7
76
+ git commit b8c1729e63dcf8e94b296d6ee90cf7c16c79d72c
77
77
  email: packaging@arvados.org
78
78
  executables:
79
79
  - arvados-login-sync