Skip to content

Commit

Permalink
Cleaning up style
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilnius Ramanauskas committed Jul 19, 2024
1 parent f526967 commit 2fce958
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/puppet/functions/gitlab_ci_runner/register.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
end

def register(url, token, additional_options = {}, ca_file = nil)
if token.start_with?('glrt-')
raise "Gitlab runner failed to register: authentication token provided instead of registration token."
end
token.start_with?('glrt-') and
raise 'Gitlab runner failed to register: authentication token provided instead of registration token.'

begin
PuppetX::Gitlab::Runner.register(url, additional_options.merge('registration-token' => token), ca_file)
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet_x/gitlab/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def self.register(host, options, proxy = nil, ca_file = nil)
def self.verify(host, token, proxy = nil, ca_file = nil)
url = "#{host}/api/v4/runners/verify"
Puppet.info "Verifying gitlab runner with #{host}"
PuppetX::Gitlab::APIClient.post(url, {'token'=>token}, proxy, ca_file)
PuppetX::Gitlab::APIClient.post(url, { 'token' => token }, proxy, ca_file)
end

def self.unregister(host, options, proxy = nil, ca_file = nil)
Expand Down

0 comments on commit 2fce958

Please sign in to comment.