Skip to content

Commit 6b0ad4e

Browse files
committed
Make lintastic
1 parent 7cbf4b8 commit 6b0ad4e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

cookbooks/boxcutter_onepassword/libraries/onepassword.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,12 @@ def self.op_connect_server_token_found?
231231

232232
def self.op_service_account_token_path
233233
op_service_account_token_path = '/etc/cinc/op_service_account_token'
234-
if ::File.exist?(op_service_account_token_path)
235-
Chef::Log.debug(
236-
"boxcutter_onepassword: using #{op_service_account_token_path} for op_service_account_token_path",
237-
)
238-
else
234+
unless ::File.exist?(op_service_account_token_path)
239235
op_service_account_token_path = '/etc/chef/op_service_account_token'
240-
Chef::Log.debug(
241-
"boxcutter_onepassword: using #{op_service_account_token_path} for op_service_account_token_path"
242-
)
243236
end
237+
Chef::Log.debug(
238+
"boxcutter_onepassword: using #{op_service_account_token_path} for op_service_account_token_path",
239+
)
244240
op_service_account_token_path
245241
end
246242

@@ -275,7 +271,8 @@ def self.token_from_env_or_file(environment_variable_name, file_path)
275271
return token
276272
end
277273

278-
fail "boxcutter_onepassword[op_service_account_token]: token not found in env #{environment_variable_name} or file #{file_path}"
274+
fail 'boxcutter_onepassword[op_service_account_token]: token not found in ' \
275+
"env #{environment_variable_name} or file #{file_path}"
279276
end
280277

281278
# ---- logging/shellout helpers ----
@@ -301,7 +298,8 @@ def self.run_shellout(command, env:, type:, event:, extra: {}, log_stdout: false
301298
Chef::Log.debug("boxcutter_onepassword[#{event}]: stdout=#{truncate(shellout.stdout)}") if log_stdout
302299

303300
Chef::Log.info(
304-
"boxcutter_onepassword[#{event}]: ok type=#{type.inspect} exitstatus=#{shellout.exitstatus} extra=#{extra.inspect}"
301+
"boxcutter_onepassword[#{event}]: ok type=#{type.inspect} " \
302+
"exitstatus=#{shellout.exitstatus} extra=#{extra.inspect}"
305303
)
306304
shellout
307305
end

0 commit comments

Comments
 (0)