Skip to content

Commit 4eb7f5a

Browse files
committed
Make lintastic
1 parent 53b481f commit 4eb7f5a

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

cookbooks/boxcutter_onepassword/libraries/onepassword.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def self.op_whoami(type = 'auto')
1111
env = op_environment(type)
1212

1313
command = "#{cli} whoami"
14-
run_shellout(command, :env => env, :type => type, :event => 'op_whoami', :log_stdout => true).stdout.strip
14+
run_shellout(command, :env => env, :event => 'op_whoami', :log_stdout => true).stdout.strip
1515
end
1616

1717
def self.op_read(reference, type = 'auto')
@@ -21,10 +21,10 @@ def self.op_read(reference, type = 'auto')
2121
# 1Password Connect Server does not support `op user get --me`
2222
if ['auto', 'service_account'].include?(type)
2323
command = "#{cli} user get --me"
24-
run_shellout(command, :env => env, :type => type, :event => 'op_user_get_me', :log_stdout => true)
24+
run_shellout(command, :env => env, :event => 'op_user_get_me', :log_stdout => true)
2525
else
2626
Chef::Log.debug(
27-
"boxcutter_onepassword[op_read]: skipping `op user get --me` for type=#{type.inspect} (connect_server)",
27+
"boxcutter_onepassword[op_read]: skipping `op user get --me` for (connect_server)",
2828
)
2929
end
3030

@@ -33,7 +33,6 @@ def self.op_read(reference, type = 'auto')
3333
run_shellout(
3434
command,
3535
:env => env,
36-
:type => type,
3736
:event => 'op_read',
3837
:extra => { :reference => reference },
3938
:log_stdout => false,
@@ -51,7 +50,6 @@ def self.op_document_get(item, vault, type = 'auto')
5150
run_shellout(
5251
command,
5352
:env => env,
54-
:type => type,
5553
:event => 'op_document_get',
5654
:extra => { :item => item, :vault => vault },
5755
:log_stdout => false,
@@ -72,7 +70,7 @@ def self.op_environment(type)
7270

7371
Chef::Log.info(
7472
"boxcutter_onepassword[op_environment]: using auth=#{chosen} requested=#{requested.inspect} " \
75-
"env_keys=#{env.keys.sort.inspect} sources=#{summarize_token_sources(env)}",
73+
"env_keys=#{env.keys.sort.inspect} sources=#{summarize_token_sources(env)}",
7674
)
7775
return env
7876
end
@@ -277,9 +275,9 @@ def self.token_from_env_or_file(environment_variable_name, file_path)
277275

278276
# ---- logging/shellout helpers ----
279277

280-
def self.run_shellout(command, env:, type:, event:, extra: {}, log_stdout: false)
278+
def self.run_shellout(command, env:, event:, extra: {}, log_stdout: false)
281279
Chef::Log.debug(
282-
"boxcutter_onepassword[#{event}]: start type=#{type.inspect} " \
280+
"boxcutter_onepassword[#{event}]: " \
283281
"command=#{command.inspect} env_keys=#{(env || {}).keys.sort.inspect} extra=#{extra.inspect}",
284282
)
285283

@@ -288,7 +286,7 @@ def self.run_shellout(command, env:, type:, event:, extra: {}, log_stdout: false
288286

289287
if shellout.error?
290288
Chef::Log.error(
291-
"boxcutter_onepassword[#{event}]: failed type=#{type.inspect} exitstatus=#{shellout.exitstatus} " \
289+
"boxcutter_onepassword[#{event}]: exitstatus=#{shellout.exitstatus} " \
292290
"command=#{command.inspect} env_keys=#{(env || {}).keys.sort.inspect} extra=#{extra.inspect} " \
293291
"stdout=#{truncate(shellout.stdout)} stderr=#{truncate(shellout.stderr)}",
294292
)
@@ -298,7 +296,7 @@ def self.run_shellout(command, env:, type:, event:, extra: {}, log_stdout: false
298296
Chef::Log.debug("boxcutter_onepassword[#{event}]: stdout=#{truncate(shellout.stdout)}") if log_stdout
299297

300298
Chef::Log.info(
301-
"boxcutter_onepassword[#{event}]: ok type=#{type.inspect} " \
299+
"boxcutter_onepassword[#{event}]: ok " \
302300
"exitstatus=#{shellout.exitstatus} extra=#{extra.inspect}",
303301
)
304302
shellout

0 commit comments

Comments
 (0)